Computer Science I / Sequential Logic and State
Practice question · Put in order

A crossing controller has four states. After Red it goes to Red-and-amber, after Red-and-amber to Green, after Green to Amber, and after Amber back to Red. The machine is currently in Green. Order the next four states it enters.

Hints
  1. Start from Green and apply the rules one at a time, writing down each state as you reach it.
  2. The machine returns to its starting state after a full cycle of four ticks.
Show the answer
  1. Amber
  2. Red
  3. Red and amber together
  4. Green
Why

From Green the rules give Amber, then Red, then Red-and-amber, then Green again, the cycle closes after four ticks. Reading the rules in the order they are listed rather than following them from the given starting state is the trap; an FSM's behaviour depends on where it currently is, not on how the transitions happen to be written down.

Read the lesson: Sequential Logic and State →

Practise Sequential Logic and State

The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Sequential Logic and State