Simple state machine’s state table

digital-logic

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?

Best Answer

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?