This project implements an 8-bit up/down counter in Verilog. The counter increments or decrements its value between 0 and 255 based on the up_down
control signal:
up_down = 1
→ counts upup_down = 0
→ counts downThe counter only updates on the rising edge of the clk
signal when the enable
input is high. An active-low reset (rst_n
) sets the counter to 0. The current counter value is output on the 8-bit uo_out
bus.
ui[0]
= enableui[1]
= up/down controlui[2]
= clock (clk
)uo[0..7]
= 8-bit counter output (q
)clk
input to a clock source (or simulation clock).ui[0]
high to enable counting.ui[1]
high to count up or low to count down.rst_n
low to reset the counter to 0.uo[0..7]
to verify the counter value.Simulation can be performed using any Verilog simulator (e.g., Icarus Verilog, ModelSim, or TinyTapeout simulation environment).
This project does not require any external hardware. All logic is contained within the TinyTapeout tile.
Optionally, the output bus uo_out
can be connected to LEDs, a logic analyzer, or other display modules to visualize the count.
# | Input | Output | Bidirectional |
---|---|---|---|
0 | enable | q[0] | |
1 | up_down | q[1] | |
2 | clk | q[2] | |
3 | q[3] | ||
4 | q[4] | ||
5 | q[5] | ||
6 | q[6] | ||
7 | q[7] |