0
\$\begingroup\$

EDIT: This is a homework question. What I need to know is how to solve the circuit through the transition table. That is, how do I write the circuits for the state changes (is it a flip-flop circuit, or a combinatorial circuit?) and the outputs?

I have a simple state machine with 3 states to control the automatic doors of a mall: waiting, entering and leaving. Two sensors, one in each side of the door, a timer that counts to 10 seconds.

The door opens when one of the sensors is activated, and remains open until the other sensor is activated or 10 seconds pass without any other input. Every time a person goes in or out, an alarm goes off. One of the suppositions is that only one person goes in or out at any time, so the sensors can't go off at the same time.

I have then 3 inputs to the circuit: S1, S2 and the Timer. And one output, the alarm A.

I was wondering how I'm supposed to write the state transitions table. I'd written something like

S1 S2 10s Q(n) Q(n+1) Alarm

0 0 0 A A 0

...

1 1 1 A X X

0 0 0 B B 0

...

1 1 1 B X X

And so on, with the 0-7 table being repeated for the states Q(n) = A, B and C.

Is this correct?

What's the next step to build the combinatorial circuit? I know I have to make the Karnaugh maps, but how do I factor in the states A, B, C? Are they supposed to be flip-flops? Are those then different "functions" I have to make the Karnaugh maps for?

\$\endgroup\$
  • \$\begingroup\$ Does your timer tick every 1 second or every 10 seconds? \$\endgroup\$ – Chris Laplante Nov 2 '13 at 21:38
  • \$\begingroup\$ No, every 1 second. Sends a signal when it reaches 10 seconds. \$\endgroup\$ – Heathcliff Nov 2 '13 at 21:46
  • \$\begingroup\$ Sorry, I worded my question poorly. I meant when is Timer asserted high - now I understand it's every 10 seconds. The reason I ask is because if Timer was asserted every second, you'd need extra states (for 1s, 2s, etc.) \$\endgroup\$ – Chris Laplante Nov 2 '13 at 21:54
  • 1
    \$\begingroup\$ There's a lot of missing information here : for one thing, your states are waiting, entering, leaving. So what are A,B,C? For another, you will need to know the requirement for sounding an alarm : "when a person goes in or out " ... when they start to do so, or when they have completed, so you can shut the store door (or wake Security) after the thief has bolted? If I trigger the outside sensor, change my mind and trigger it again, do you sound the alarm or not? If I get halfway in, stand very still, does the door close on me in 10 seconds? You may need a fuller specification. \$\endgroup\$ – Brian Drummond Nov 2 '13 at 22:02
  • 1
    \$\begingroup\$ I must be missing something, better states for me seem to be Open, Closing, Closed and Opening. Entering and Leaving are actions that trigger state changes. Ignore me. ;) \$\endgroup\$ – kenny Nov 3 '13 at 3:49
1
\$\begingroup\$

I think you need to develop a state machine diagram similar to this (for how water is affected by stuff): -

enter image description here

Don't scrimp and scrape on "we don't need to worry about this or that" or "The supposition is that no one stays 10 seconds under the door" because you will not get a great answer because people will become disenchanted and think it is homework - just in case it is homework there is a tag you could have selected!!

You can still draw a state machine diagram and show the transistions you are discounting like the "supposition is that no one stays 10 seconds under the door" etc..

I'm sorry for sounding harsh or ultra critical but you do want this to be right, yeah?

\$\endgroup\$
  • \$\begingroup\$ Is there a way to edit the title to put the tag? I don't find one in the Tags section. \$\endgroup\$ – Heathcliff Nov 3 '13 at 1:29
  • \$\begingroup\$ There used to be a homework tag. If it's no longer available it's advisable to mention this in the question. I would draw a state diagram because it's gonna be easier to see the logic even if ultimately a state diagram is not what the assignment is about. \$\endgroup\$ – Andy aka Nov 3 '13 at 12:49
  • \$\begingroup\$ I made an edit to my original post. My problem is how to find the functions to create the circuit that solves the problem through the state transition tables. \$\endgroup\$ – Heathcliff Nov 3 '13 at 15:02
  • \$\begingroup\$ @Andyaka, The homework tag was deprecated. We're asked to tag questions according to their content, not according to meta-issues. There was a post about this on Meta and on Meta.SO. OP should not be required to re-state this in his question. \$\endgroup\$ – The Photon Nov 3 '13 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.