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

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • Logic Synthesis Glossary
  • Logic Synthesis Cheatsheet
  • Synthesis Foundations14
  • Logic Optimisation and Mapping20
    • Boolean Optimisation
      • Constant Propagation
      • Redundancy Removal
      • Factoring, Collapsing and Sharing
      • AIGs, Depth and Area
      • Don't-Cares
    • Technology Mapping
    • Cell Libraries and Liberty
    • Structuring and Buffering
  • Constraints and Timing15
  • Sequential, FSM and Memory19
  • Datapath Synthesis14
  • Area, Power and Test14
  • Verification, ECO and Handoff15
  • Flows and Debugging15
  • Interview and Judgment11
Loading lesson

←Logic Optimisation and Mapping
  1. Topics
  2. Logic Synthesis
  3. Logic Optimisation and Mapping
  4. Boolean Optimisation
On this page

    Part 2 of 9Part 2 of 9/Logic Optimisation and MappingIntermediate

    Boolean Optimisation

    Constant propagation, redundancy removal, sharing, and the depth-area trade-off.

    • 5topics
    • 5lessons

    Every later area or timing win in this part rests on rewrites that must preserve the function. Without the order and the proofs, optimisation looks like guesswork and every mapped number is suspect.

    After this lesson you can: name the rewrite order, say which pass owns each redundancy, and decide when a rewrite is worth its depth cost.

    Boolean optimisation rewrites a logic network into a cheaper equivalent without changing what it computes. Every rewrite in this topic answers the same two questions: which gates can go, and how do you know the function survived? The five lessons below run real Yosys and ABC scripts, so each answer comes with a recorded report instead of a sketch.

    The rewrites run in a typical order, iterated to a fixed point: Yosys opt repeats its passes until nothing changes, so each pass cleans up after the last. Constants fold first, since a tied input can delete a whole cone and expose new duplicates. Redundancy removal merges what the folding exposed. Sharing and factoring then trade literals against depth, the depth-area step rebalances the result, and AIG rewriting works the whole cone at once. Don't-care simplification runs last, because it changes the function on purpose and needs the care set written down before anything else moves.

    Rewrite

    What it removes

    Risk

    Constant propagation

    Gates with a tied input and everything they imply

    None: the function is unchanged on every input.

    Redundancy removal

    Duplicate gates and dead logic

    None: the function is unchanged on every input.

    Sharing and factoring

    Repeated sub-expressions and excess literals

    Depth can grow while area shrinks.

    AIG rewriting and balancing

    Depth and redundant structure across the whole cone

    Generic depth only hints at the mapped delay.

    Don't-care simplification

    Minterms the environment never produces or never observes

    Wrong care-set claims change the function.

    Flowchart of the Boolean optimisation passes in run order from constants to mapping.
    The rewrite passes in run order: constants fold, four opt passes simplify, merge, prune and delete, sharing and factoring restructure, depth trades against area, don't-cares minimise last, then mapping covers the result.

    Read the flowchart as a typical round, not a rigid script. Each box consumes the netlist the previous box wrote: folding turns gates into wires and constants, the four opt passes simplify those expressions, merge the duplicates they expose, prune dead mux branches and delete what is left unused, sharing reuses repeated cones, the depth step rebalances slow paths, and the don't-care step is allowed to change answers only where the care set says nobody looks. Iteration repeats the round until nothing changes. Mapping then covers whatever survives with library cells.

    The five lessons

    Lesson

    What it covers

    Constant propagation

    Folding tied inputs through gates, masks and flops, with recorded before and after reports.

    Redundancy removal

    Duplicate, dead and self-cancelling logic, with a solver proof that the function survived.

    Factoring, collapsing and sharing

    Literal counts and sub-expression reuse, priced by hand and mapped by ABC.

    AIGs, depth and area

    And-Inverter Graphs and the depth-area trade-off on chains, trees and an adder.

    Don't-cares

    External and observability don't-cares, with a Karnaugh map and a proof.

    What you can do after this topic

    You can read an optimisation log and say which pass did what: which lines folded constants, which merged duplicates, which deleted dead logic. You can predict what a tied input does to its cone before running the tool, and you can set up the solver proof that checks a rewrite kept the function. You can price a factored form by hand, read the mapped area ABC reports for the same function, and explain any gap between the two without guessing.

    You can also say when to stop. A rewrite that deletes gates but adds a level of depth is only a win if the path had slack. A don't-care claim is only safe with a source in the specification. Those two judgements, plus the habit of proving each rewrite instead of eyeballing it, are what this topic is for. The next topic spends them on library cells.

    Check yourself A rewrite drops three gates but adds one level of depth. Which table row warns about that exchange, and what must still hold?

    The sharing and factoring row. Depth can grow while area shrinks, and the function must stay identical on every input combination.

    Check yourself Two runs of identical RTL give different mapped netlists. Name the two inputs to the mapper that this topic varies across its lessons.

    The delay target with its constraint file, and the cell library. The Area Against Delay lesson in technology-mapping varies the target against sized.lib, and the sharing lesson maps one function against course.lib and nand_only.lib.

    Prove you can optimise without breaking the function.

    • Weak: optimisation makes the design smaller and faster, and the tool checks it.

    • Strong: constants fold forward and delete whole cones with the function unchanged on every input; redundancy removal deletes only provably useless gates, which the solver proof on the redundancy lesson confirms for all four input pairs; factoring trades literals against depth, so it is only a win where the path has slack; and don't-cares are claims about the environment that need a source, because a wrong one is a functional bug.

    • Follow-up: show me a rewrite you would refuse, and how you would prove the refusal was right.

    • Constants fold first, redundancy merges second, sharing trades literals against depth, don't-cares minimise last.

    • Each redundancy belongs to the pass that can see it: duplicates to opt_merge, absorption to ABC's hashing and rewriting.

    • A rewrite is only a win where the path has slack and the proof covers every input.

    Rule of thumb: prove each rewrite on every input before you price it.

    How this was checked

    This hub runs no tool itself. Its numbers and pictures live in the five lessons below, each recorded from Yosys 0.69+post with ABC by the course checker (scripts/tools/run-rtl-testbenches.mjs with COURSE=synth). The teaching libraries course.lib and nand_only.lib are fictional, so absolute areas are teaching units; the shapes of the trade-offs are the point.

    • Interview: run a mock interview on this topic

    Related topics

    • Up: Logic Optimisation and Mapping

    • Next: Technology Mapping

    PreviousNext: Constant Propagation

    Up next

    Up nextConstant Propagation

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Technology Mapping
    • Cell Libraries and Liberty
    • Structuring and Buffering