
The core is an 8-bit shift register (8 D flip-flops). A direction flip-flop controls which way the lit bit moves:
Each flop's D input is a 2-AND + OR mux that selects left or right neighbor based on direction. When the lit bit reaches either end of the chain, the turn-around detection flips the direction flip-flop, so the light bounces back.
On reset, flop 1 is SET while flops 2–8 and the direction flop are cleared.
Outputs: uo[0]–uo[7] map directly to LEDs 1–8.
uo[0]–uo[7].Expected output sequence one LED on at a time 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 ...
8 LEDs and resistors. A switch or pushbutton for reset.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | reset (active low) | LED 1 (leftmost) | |
| 1 | LED 2 | ||
| 2 | LED 3 | ||
| 3 | LED 4 | ||
| 4 | LED 5 | ||
| 5 | LED 6 | ||
| 6 | LED 7 | ||
| 7 | LED 8 (rightmost) |