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
    • Multipliers and Compressors
      • Partial Products and the Array Multiplier
      • Booth Radix-4 Recoding
      • Compressor Trees
      • Signed Multiplication and Sign Extension
      • Truncation, the Final Adder, and Equivalence
    • Resource Sharing and Arithmetic Inference
  • Area, Power and Test14
  • Verification, ECO and Handoff15
  • Flows and Debugging15
  • Interview and Judgment11
Loading lesson

‹Multipliers and Compressors
  1. Topics
  2. Logic Synthesis
  3. Datapath Synthesis
  4. Multipliers and Compressors
  5. Truncation, the Final Adder, and Equivalence

Part 5 · Datapath Synthesis · Intermediate

Truncation, the Final Adder, and Equivalence

Truncation, the final adder choice, and a Yosys equivalence proof.

On this page

    Truncation keeps the low bits

    Keeping the low k bits of a product is exact modulo 2^k. It suits wraparound arithmetic and silently corrupts anything else.

    Only the specification decides which bits survive. The calc below pins the kept and dropped parts of one example.

    Diagram
    a = 200, b = 150, exact product = 30000 = 0x7530
    keep low 8 bits: 0x30 = 48
    check: 30000 = 117 x 256 + 48 = 29952 + 48
    keep low 12 bits: 30000 mod 4096 = 30000 - 7 x 4096 = 30000 - 28672 = 1328
    kept value = product mod 2^k; the dropped 29952 is the truncation penalty at 8 bits

    Kept bits

    Result for 30000

    Exact?

    16

    30000

    Yes: the full product fits.

    12

    1328

    Only modulo 4096.

    8

    48

    Only modulo 256.

    The final adder

    Two compressed rows need one carry-propagate addition. A 4 by 4 product adds two 8-bit rows.

    Ripple is fine at that width, and wider products favour the faster families from the Adders and Carry Structures topic. Which family wins varies with the library and the timing target.

    Proving a small multiplier in Yosys

    The script below builds a 4 by 4 array beside a behavioural multiply and proves them equivalent. It asserts the property with equivalence checking, not with brittle cell counts.

    yosys
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    read_verilog <<EOV
    module mult_ref(input [3:0] a, input [3:0] b, output [7:0] p);
      assign p = a * b;
    endmodule
    module mult_arr(input [3:0] a, input [3:0] b, output [7:0] p);
      wire [7:0] pp0 = {4'b0, (a & {4{b[0]}})};
      wire [7:0] pp1 = {4'b0, (a & {4{b[1]}})} << 1;
      wire [7:0] pp2 = {4'b0, (a & {4{b[2]}})} << 2;
      wire [7:0] pp3 = {4'b0, (a & {4{b[3]}})} << 3;
      assign p = pp0 + pp1 + pp2 + pp3;
    endmodule
    EOV
    hierarchy
    proc
    opt
    equiv_make mult_ref mult_arr mult_equiv
    equiv_simple
    equiv_status -assert
    log PASS: 4x4 array multiplier proved equivalent to behavioural multiply

    Common pitfall

    Pinning exact ABC cell counts for a multiplier makes the test track the mapper, not the design. Prove equivalence with the solver and assert robust properties instead; exact counts belong only to deterministic generic passes.

    Interview

    Likely probes: what truncation guarantees, and how the proof differs from a count.

    • Truncation to k bits keeps the product modulo 2^k, nothing more.

    • The final adder is one carry-propagate add of the last two rows.

    • The Yosys block proves equal outputs for all inputs; a count only snapshots one build.

    Check yourself The product is 30000 and only 8 bits are kept. What value survives, and what was dropped?

    48 survives, which is 30000 modulo 256. The dropped 29952 is the truncation penalty.

    Check yourself The Yosys block replaces a cell-count assertion with an equivalence proof. What does the proof cover that the count does not?

    All 256 input pairs: equal outputs for every input. A count covers one build and can pass while the logic is wrong.

    Related topics

    • Previous: Signed multiplication

    • Adders and Carry Structures

    • Equivalence Checking

    Previous

    80 / 139

    Next: Resource Sharing and Arithmetic Inference

    Up next

    Up nextResource Sharing and Arithmetic Inference

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Partial Products and the Array Multiplier
    • Booth Radix-4 Recoding
    • Compressor Trees