
This project implements a digital stopwatch in Verilog with the following features:
The design is targeted for Tiny Tapeout, complying with I/O constraints by using display multiplexing and bidirectional pins.
It includes:
The system is composed of the following blocks:
Generates a tick every 10 ms from the main clock (50 MHz).
btn_start: toggles run/pause statebtn_lap: toggles display mode (live / lap)Captures the current counter values when LAP mode is activated.
Controls 4 digits using:
segments[7:0]anodes[3:0]Each button includes:
ui_in)| Bit | Signal |
|---|---|
| 0 | btn_start |
| 1 | btn_lap |
| 2–7 | unused |
uo_out)| Bit | Segment |
|---|---|
| 0 | a |
| 1 | b |
| 2 | c |
| 3 | d |
| 4 | e |
| 5 | f |
| 6 | g |
| 7 | dp |
uio)| Bit | Signal |
|---|---|
| 0 | anode_0 |
| 1 | anode_1 |
| 2 | anode_2 |
| 3 | anode_3 |
| 4–7 | unused |
rst_n = 0), the counter initializes to 00.00.The file tb.v verifies:
uo_out → segmentsuio_out[3:0] → anodesrunninglap_modeTo speed up simulation, the prescaler value can be reduced:
parameter MAX_COUNT = 500; // instead of 500000
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | btn_start | seg_a | anode_0 |
| 1 | btn_lap | seg_b | anode_1 |
| 2 | seg_c | anode_2 | |
| 3 | seg_d | anode_3 | |
| 4 | seg_e | ||
| 5 | seg_f | ||
| 6 | seg_g | ||
| 7 | seg_dp |