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

Fixed Point Saturation Logic

MediumLogic CircuitBuild

Audio and video processing pipelines cannot tolerate arithmetic wrap-around. A bright white pixel that overflows into pitch black creates a catastrophic visual glitch.

Implement a 4-bit signed saturating adder. When the sum of two 4-bit two's complement numbers A and B exceeds the maximum positive value, clamp the output Y to 0111. When the sum falls below the minimum negative value, clamp the output Y to 1000. If no overflow occurs, Y must equal the exact sum.

| A | B | Y | |-----|-----|-----| | 0010 | 0011 | 0101 | | 0110 | 0011 | 0111 | | 1100 | 1101 | 1001 | | 1001 | 1110 | 1000 |

Constraints

  • Combinational logic only.
  • Do not use pre-built saturating adder components.

Topics

CombinationalAdderALU

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