Home › Practice › RTL Design › Running lights

Running lights

EasyRTLsequential

Four lights in a row, exactly one on. The lit light moves along and wraps around, like a marquee sign.

Concept first. A shift register moves its bits one place on every clock edge. A ring counter connects the last bit back to the first, so a single 1 inside it circulates forever instead of falling off the end. Starting with one 1 and the rest 0 is called one-hot. Four flip-flops give four states, and each state is already a ready-made "which light is on" signal, so no decoder is needed. Draw the four states one under another and see which way the 1 travels.

What to build.

Solve in your browser →

No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.

More in this track

← Blink an LED at half speedHow many lights are on? →