Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Logic Synthesis Glossary
  • Logic Synthesis Cheatsheet
  • Synthesis Foundations14
  • Logic Optimisation and Mapping20
  • Constraints and Timing15
  • Sequential, FSM and Memory19
  • Datapath Synthesis14
    • Adders and Carry Structures
      • Ripple-Carry Adders
      • Carry-Lookahead Adders
      • Carry-Select Adders
      • Prefix Adders
      • The Plus Operator and Carry-Save Addition
    • Multipliers and Compressors
    • Resource Sharing and Arithmetic Inference
  • Area, Power and Test14
  • Verification, ECO and Handoff15
  • Flows and Debugging15
  • Interview and Judgment11
Loading lesson

‹Adders and Carry Structures
  1. Topics
  2. Logic Synthesis
  3. Datapath Synthesis
  4. Adders and Carry Structures
  5. The Plus Operator and Carry-Save Addition

Part 5 · Datapath Synthesis · Intermediate

The Plus Operator and Carry-Save Addition

How synthesis maps the plus operator and how carry-save sums many operands.

On this page

    From plus to hardware

    Writing a + b asks for an adder but names no architecture. The tool picks ripple, lookahead, select, or prefix from timing and area constraints, width, and context.

    The same plus can map differently under different constraints. A tight timing goal steers toward a faster, larger structure, while a tight area goal steers toward a ripple-like one; the exact choice varies by tool and library.

    Carry-save for many operands

    Adding M operands with M - 1 propagating adders ripples M - 1 times. Carry-save avoids that by never propagating until the end.

    A 3:2 compressor takes three bits of equal weight and emits a sum bit and a carry bit. The carry bit has weight one higher, so the carry vector enters the next stage shifted by one with a zero in the lowest bit.

    Ones among the 3 inputs

    s (parity)

    cout (majority)

    0

    0

    0

    1

    1

    0

    2

    0

    1

    3

    1

    1

    Compressor levels reduce M vectors to 2, then one carry-propagating adder finishes. The calc block counts full adders for four 8-bit operands.

    Diagram
    4 operands of 8 bits each
    first compressor level: 8 full adders turn 3 operands into sum and carry vectors
    second level: 8 full adders turn those 2 vectors plus the fourth operand into 2 vectors
    compressor full adders: 2 x 8 = 16 = (4 - 2) x 8
    then one 8-bit carry-propagating adder finishes the sum

    Measured at four bits

    The Yosys script builds a structural 4-bit ripple and a 4-bit plus operator. It runs generic passes only, so the counts below are structural properties, not library mapping.

    The ripple side pins at least 4 xor cells and 4 and cells. The plus side pins at least one add cell, which is how the operator survives generic optimization.

    yosys
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    read_verilog <<EOV
    module ripple4(input [3:0] a, b, input cin, output [3:0] s, output cout);
    wire [4:0] c;
    assign c[0] = cin;
    assign s[0] = a[0] ^ b[0] ^ c[0];
    assign c[1] = (a[0] & b[0]) | (c[0] & (a[0] ^ b[0]));
    assign s[1] = a[1] ^ b[1] ^ c[1];
    assign c[2] = (a[1] & b[1]) | (c[1] & (a[1] ^ b[1]));
    assign s[2] = a[2] ^ b[2] ^ c[2];
    assign c[3] = (a[2] & b[2]) | (c[2] & (a[2] ^ b[2]));
    assign s[3] = a[3] ^ b[3] ^ c[3];
    assign c[4] = (a[3] & b[3]) | (c[3] & (a[3] ^ b[3]));
    assign cout = c[4];
    endmodule
    EOV
    hierarchy -check -top ripple4
    proc
    opt_clean
    check
    stat
    select -assert-min 4 t:$xor
    select -assert-min 4 t:$and
    design -reset
    read_verilog <<EOV
    module plus4(input [3:0] a, b, input cin, output [3:0] s, output cout);
    assign {cout, s} = a + b + cin;
    endmodule
    EOV
    hierarchy -check -top plus4
    proc
    opt_clean
    check
    stat
    select -assert-min 1 t:$add
    log PASS: 4-bit ripple and plus-operator adders map as asserted under generic passes

    Common mistakes

    Common pitfall

    Forgetting the final propagating adder after a carry-save tree. The tree outputs two vectors, not a number; only the closing adder produces the sum. Misaligning the shifted carry vector is the same bug one bit over.

    Interview

    Likely probes: operator mapping and multi-operand sums.

    • Plus names a function, and constraints plus context pick the architecture.

    • Carry-save reduces M operands with (M - 2) x N full adders, then one propagate.

    • The carry vector is shifted by one with zero in the lowest bit.

    Check yourself Three 8-bit operands feed a carry-save stage. How many full adders, and what comes out?

    8 full adders, one per bit. A sum vector and a carry vector come out, and the final sum still needs a propagating adder.

    Check yourself The Yosys script pins xor and and cells on one side and an add cell on the other. What does that comparison show?

    The structural ripple stays as bit-level logic while the plus operator survives generic passes as an arithmetic cell. Mapping to real gates happens later and varies by library.

    Related topics

    • Prefix adders

    • See also: Timing-Driven Synthesis

    Previous

    75 / 139

    Next: Multipliers and Compressors

    Up next

    Up nextMultipliers and Compressors

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Ripple-Carry Adders
    • Carry-Lookahead Adders
    • Carry-Select Adders