
This is a 4-bit binary counter that shows its value in hexadecimal on a 7-segment display. It is built only from logic gates in Wokwi and has three blocks:
clk clock.
When rst_n is 0, all four are cleared to 0 (active-low reset).Q + 1. On every rising
clock edge this value is loaded into the register. After F (15) it wraps back to 0.The display shows 0 1 2 3 4 5 6 7 8 9 A b C d E F and then starts again.
The decimal point (uo[7]) is a direct copy of input ui[7].
| Pin | Signal |
|---|---|
uo[0]..uo[6] |
segments a..g |
uo[7] |
decimal point (same as ui[7]) |
ui[7] |
decimal point input |
rst_n to 0 and then back to 1: the display shows 0.0, 1, 2, ... 9, A, b, C, d, E, F, 0, ...ui[7] to 1 and the decimal point turns on. Set it to 0 and it turns off.In the Wokwi simulation, the slide switch selects between the 1 Hz clock and the Paso (step) button (S key), and the REINICIAR (reset) button (R key) clears the counter to 0.
The 7-segment display on the Tiny Tapeout demo board, connected to uo[0]..uo[7].
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | |||
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | |||
| 6 | |||
| 7 |