Half Adder (1-Bit)

The foundation of computational arithmetic. Toggle the inputs A and B below to observe how the XOR gate generates the Sum and the AND gate computes the Carry-Out.

๐Ÿ”ฌ INTERACTIVE SILICON SIMULATOR
Input A
Input B
SUM (A โŠ• B)
0
CARRY (A ยท B)
0
๐Ÿ“Š TRUTH TABLE
ABSUMCARRY
๐Ÿ“„ VERILOG RTL
// 1-Bit Half Adder Module
module half_adder (
    input  wire a,
    input  wire b,
    output wire sum,
    output wire carry
);
    // Sum is the XOR of A and B
    assign sum   = a ^ b;
    
    // Carry is the AND of A and B
    assign carry = a & b;

endmodule