
The design is a gate-level hexadecimal 7-segment decoder with a switchable 4-bit up-counter. It is built entirely from logic gates in Wokwi.
MODE (ui[4]) is 0, the value comes from X3..X0 (ui[3:0]). When MODE is 1, it comes from the counter.a–g (uo[6:0]) is a separate sum-of-products made from AND, OR and NOT gates. The decoder shows 0–9 and A–F. The outputs are active-high (for a common-cathode display).clk. Q0 toggles every clock. Each higher bit is XORed with the carry from the bits below it (C2 = Q1·Q0, C3 = Q2·C2). The counter wraps from F to 0.uo[7] is Q3·Q2·Q1·Q0, so it lights when the counter is at F.rst_n is inverted and drives the reset of all four flip-flops. Holding rst_n low clears the counter to 0.The counter keeps running in switch mode as well. MODE only selects which value is displayed.
rst_n low, then release it).ui[4] = 0 and apply each value 0000–1111 on ui[3:0]. Check that the display shows 0–9, A–F.ui[4] = 1 and single-step clk, or run it at a few Hz. The digit should go up by one per clock, uo[7] (DP) should light at F, and the next clock should wrap back to 0.rst_n low at any point. The counter should return to 0.You can also try the design in the Wokwi simulation: https://wokwi.com/projects/478036993243342849
None beyond the Tiny Tapeout demo board. It uses the on-board DIP switches (ui[4:0]), the 7-segment display (uo[7:0]), and the clock/reset controls.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | X0 | SEG_A | Unused bidirectional pin |
| 1 | X1 | SEG_B | Unused bidirectional pin |
| 2 | X2 | SEG_C | Unused bidirectional pin |
| 3 | X3 | SEG_D | Unused bidirectional pin |
| 4 | MODE (0=switches, 1=counter) | SEG_E | Unused bidirectional pin |
| 5 | Unused input | SEG_F | Unused bidirectional pin |
| 6 | Unused input | SEG_G | Unused bidirectional pin |
| 7 | Unused input | DP (counter at F) | Unused bidirectional pin |