CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Arithmetic

Debugging Saturating Adder

MediumLogic CircuitDebug

An 8-bit unsigned saturating adder is used in digital signal processing datapathes to prevent arithmetic wrap-around distortion. The circuit computes the sum of two 8-bit unsigned inputs A and B and clamps the output Sum to the maximum 8-bit value if an overflow occurs.

Expected behavior:

If A + B <= 255, the output Sum equals A + B. If A + B > 255, the output Sum saturates to 255.

Simulation shows Sum = 0 for inputs A = 255 and B = 1. The output wraps around instead of saturating to the maximum value. Inspect the circuit and correct the fault.

Constraints

  • Do not change the input or output port definitions.
  • Ensure the saturation logic evaluates the full precision sum before truncation.

Topics

adderdatapathoverflowsaturation

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Related problems

  • Half Adder Using Only XOR and ANDEasy
  • Floating Point Exception FlagsMedium
  • 1-Bit ALU SliceMedium
  • 4-bit Carry Lookahead BlockHard
  • BCD Adder Correction BlockMedium
  • IEEE 754 Mantissa Alignment ShifterHard
  • Four-Bit Bus AdderEasy
  • Debugging Twos Complement OverflowMedium

Browse all problems · Learning tracks