BitFlow

Scoreboard

Button 0 scores a point for home (hex3 hex2), button 1 for away (hex1 hex0), each counting 00 to 99 in decimal. Switch 0 resets both to 00.

Two of the same thing is a good reason for a module: write a two-digit decimal counter once and use it twice.

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

  • ○Button 0 adds a point for home
  • ○Button 1 adds a point for away
  • ○Scores are shown in decimal and switch 0 resets them
Hints
  1. A bcd2 module with inc, reset and two 4-bit digit outputs.
  2. Each counter's inc is its button going from 0 to 1.

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 switches or 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