| Status | Title | Difficulty | Tags |
|---|---|---|---|
A Half Adder is a basic combinational circuit that performs the addition of two 1-bit binary numbers.
It produces two outputs:
In this tutorial, you will design a half adder using Verilog and test it with all input combinations.
The half adder cannot handle carry-in from previous additions (that’s why it’s called half).
It is the simplest building block for binary addition.
S = A ⊕ BC = A · BCreate a Verilog module named half_adder with:
a, bsum, carryImplement the equations:
assign sum = a ^ b;assign carry = a & b;Write a testbench module to verify the half adder:
a and b (00, 01, 10, 11).sum and carry.| a | b | sum | carry |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
Submit your Verilog code using Cmd+Enter to see the simulation results and waveform visualization.