Close Menu
VLSI Web
  • Home
    • About Us
    • Contact Us
    • Privacy Policy
  • Digital Design
    • Digital Circuits
    • Verilog
    • VHDL
    • System Verilog
    • UVM
  • VLSI Roles
    • RTL Design
    • Design Verification
    • Physical Design
    • DFT
    • STA
  • Interviews
  • Informative
  • VLSI Forge
Instagram LinkedIn WhatsApp Telegram
Instagram LinkedIn WhatsApp Telegram
VLSI Web
  • Home
    • About Us
    • Contact Us
    • Privacy Policy
  • Digital Design
    • Digital Circuits
    • Verilog
    • VHDL
    • System Verilog
    • UVM
  • VLSI Roles
    • RTL Design
    • Design Verification
    • Physical Design
    • DFT
    • STA
  • Interviews
  • Informative
  • VLSI Forge
VLSI Web
Digital Circuits

Adders and Subtractors: Half, Full, Ripple-Carry and Carry-Lookahead

Raju GorlaBy Raju Gorla23 August 2026Updated:11 October 2026No Comments3 Mins Read
Adders and subtractors explained
Share
Facebook Twitter LinkedIn Email Telegram WhatsApp

The short answer: a half adder adds two bits and gives a sum (A XOR B) and a carry (A AND B). A full adder adds three bits, including a carry in, giving S = A XOR B XOR Cin and Cout = A·B + Cin·(A XOR B). Chain N full adders and you get a ripple-carry adder; compute the carries in parallel and you get a much faster carry-lookahead adder. Subtraction is just addition of the two’s complement: A − B = A + B’ + 1.

Adders are the most important arithmetic block in any processor, and a favourite interview topic. This post combines my older posts on adders and subtractors.

  1. From half adder to fast adders
  2. Half and full adder truth tables
  3. Ripple-carry vs carry-lookahead
  4. Subtractors and two’s complement
  5. Adders in Verilog

Table of Contents

  • Part 1: From half adder to fast adders
  • Part 2: Half and full adder truth tables
  • Part 3: Ripple-carry vs carry-lookahead
  • Part 4: Subtractors and two’s complement
  • Part 5: Adders in Verilog
  • FAQ
    • Why is it called a half adder?
    • Which adder is fastest?
    • How is overflow detected in signed addition?
    • Should I write adders gate by gate in RTL?

Part 1: From half adder to fast adders

From half adder to fast adders: half, full, ripple-carry, carry-lookahead and subtractor
Each step adds capability or speed.

Part 2: Half and full adder truth tables

A B Cin Sum Cout
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1

A half adder is the top half of this table with Cin = 0.

Part 3: Ripple-carry vs carry-lookahead

A ripple-carry adder chains full adders, so each carry waits for the one before it. Delay grows linearly with the width, which is too slow for wide adders at high clock speeds.

A carry-lookahead adder computes, for each bit, generate G = A·B and propagate P = A XOR B, then calculates carries directly: C1 = G0 + P0·C0, C2 = G1 + P1·G0 + P1·P0·C0, and so on. Grouped into blocks, this makes the delay grow roughly logarithmically. Other fast designs include carry-select and parallel-prefix adders such as Kogge-Stone.

Part 4: Subtractors and two’s complement

A half subtractor gives difference A XOR B and borrow A’·B; a full subtractor adds a borrow in. In practice, chips subtract with an adder: invert B, set the carry in to 1, and add. That is why an ALU can add and subtract with the same hardware.

Part 5: Adders in Verilog

// Full adder
module full_adder (
  input  wire a, b, cin,
  output wire sum, cout
);
  assign sum  = a ^ b ^ cin;
  assign cout = (a & b) | (cin & (a ^ b));
endmodule

// N-bit adder/subtractor: let synthesis choose the architecture
module addsub #(parameter N = 8) (
  input  wire [N-1:0] a, b,
  input  wire         sub,     // 0 = add, 1 = subtract
  output wire [N-1:0] y,
  output wire         cout
);
  assign {cout, y} = a + (sub ? ~b : b) + sub;
endmodule

In real RTL, write the behaviour with + and -. Synthesis picks a ripple, lookahead or prefix adder depending on your timing constraints.

Practise this on VLSI Forge

I built VLSI Forge so you can write RTL in your browser, run it on a real simulator and check every signal in the waveform. Free, nothing to install.

Arithmetic problems · Build a RISC-V ALU

FAQ

Why is it called a half adder?

Because it cannot accept a carry in, so two half adders (plus an OR gate) are needed to make a full adder.

Which adder is fastest?

Parallel-prefix adders like Kogge-Stone are among the fastest, at the cost of more area and wiring.

How is overflow detected in signed addition?

Overflow occurs when the carry into the sign bit differs from the carry out of it.

Should I write adders gate by gate in RTL?

No. Use + and -, and let synthesis choose the best architecture for your timing.

Share. Facebook Twitter LinkedIn Email Telegram WhatsApp
Previous ArticleCombinational Logic Design: A Step-by-Step Guide
Next Article Arithmetic Circuits: Comparators, Multipliers and the ALU
Raju Gorla
  • Website

Related Posts

Digital Circuits

Registers and Shift Registers: SISO, SIPO, PISO and PIPO

3 September 2026
Digital Circuits

Counters and Clock Dividers in Verilog

2 September 2026
Digital Circuits

Mealy vs Moore State Machines: Differences, Examples and Verilog

1 September 2026
Add A Comment
Leave A Reply Cancel Reply

Topics
  • Digital Circuits
  • Informative
  • Interview Questions
  • Physical Design
  • RTL Design
  • STA
  • System Verilog
  • UVM
  • Verilog
Instagram LinkedIn WhatsApp Telegram
  • About
  • Contact
  • Privacy Policy
  • VLSI Forge
  • Courses
  • Feedback
© 2026 VLSI Web

Type above and press Enter to search. Press Esc to cancel.