Arithmetic & Math
8-Bit Incrementer
Combinational 8-bit incrementer with carry-out detection.
About this block
Simulate it in the Verilog IDE
8-Bit Incrementer is a Verilog reference block in the Arithmetic & Math catalog. Adders, multipliers, dividers, ALUs, and arithmetic datapaths. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.
This IP core implements a simple, purely combinational 8-bit incrementer. It accepts an 8-bit input (din), outputs the incremented value (dout), and asserts a carry-out signal (cout) when the input is the maximum value (0xFF).
This design is suitable for use in counters, address generators, or simple arithmetic logic units where low latency and no clock dependency are required.
- Choose Open in IDE. RTL Studio loads the packaged workspace for 8-Bit Incrementer.
- Read the Verilog module in the editor. The catalog line for this block: Combinational 8-bit incrementer with carry-out detection.
- Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
- Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.
RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.
Features
- Combinational Logic: No clock dependency; immediate output update.
- 8-Bit Width: Handles inputs from
0x00to0xFF. - Carry-Out: Explicitly asserts
couton overflow (0xFF->0x00). - Verified: Includes a testbench covering zero, near-overflow, and wrap-around cases.
Architecture
The module performs a direct addition of the constant 1 to the 8-bit input din. To correctly handle the carry-out for the full 8-bit range, the design uses a separate logic check to determine if the input was the maximum value (0xFF).
### Block Diagram
Ports
| Port Name | Direction | Width | Description |
|---|---|---|---|
din | Input | 8 | Input data word to be incremented. |
dout | Output | 8 | Result of din + 1. |
cout | Output | 1 | Carry out, asserted (1) if din was 0xFF, otherwise 0. |
Verification
The provided testbench (tb/tb_incrementer_8bit.v) verifies three critical cases:
- Zero Increment: Input
0x00should result in0x01withcout=0. - Near Overflow: Input
0xFE(254) should result in0xFFwithcout=0. - Wrap-Around: Input
0xFF(255) should result in0x00withcout=1.
### Expected Simulation Output
Upon successful simulation, the log should display:
If any test fails, the simulator will output a detailed error message indicating the expected and actual values.
More in Arithmetic & Math
- 1-Bit Full Adder
- 1-Bit Full Adder — L1 Upgrade — L2 Upgrade
- 1-Bit Half Adder
- 16-Bit Carry-Select Adder
- 16-Bit Signed Adder with Overflow
- 2-Bit Saturating Up/Down Counter — L2 Upgrade
- 32-Bit Count Leading Zeros
- 32-Bit Equality Comparator — L1 Upgrade — L2 Upgrade
- 32-Bit Population Count — L1 Upgrade — L2 Upgrade
- 4-bit Adder-Subtractor with Overflow
- 4-Digit BCD Adder with Carry Propagation — L2 Upgrade
- 4-Input 8-Bit Adder Tree — L2 Upgrade
- 8-Bit Absolute Value — L1 Upgrade
- 8-Bit ALU Slice with Add/Sub and Logic Ops — L2 Upgrade
- 8-Bit Carry-Save Adder (3:2) — L2 Upgrade
- 8-Bit Count Trailing Zeros — L1 Upgrade — L2 Upgrade