BitFlow

Digital clock

A clock is the stopwatch counting seconds instead of tenths: hex3 hex2 are minutes 00–59 and hex1 hex0 seconds 00–59, carrying from seconds into minutes and wrapping from 59:59 to 00:00.

Clocks need setting: each press of button 0 adds a minute, and button 1 resets to 00:00.

lab.v
drag to turn · scroll to zoom

Loading the board…

Press Run on the board: your Verilog is turned into gates in this browser and runs here, cycle by cycle.

Goals

  • ○Seconds count once a second and carry into minutes
  • ○Button 0 adds a minute
  • ○Button 1 resets to 00:00
  • ○59 minutes wraps back to 00
Hints
  1. Four digit registers and a one-second timer, like the stopwatch.
  2. Adding a minute is the same carry as a minute passing: write it once and use it for both.

Pin log

Run the design to see its outputs change.

Put it on a real board

  • The Sipeed Tang Nano 9K (Gowin GW1NR-9) has no a 7-segment display: those ports go to header pins, where you can wire them.
  • The clock is set to the board's 27 MHz, and its active-low buttons and LEDs are flipped for you.
Waveform