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

Floating Point Exception Flags

MediumLogic CircuitBuild

Floating-point units must flag special numerical cases immediately to prevent processor pipeline stalls or silent data corruption. These exception flags inform the control logic when an arithmetic operation results in infinity, zero, or an invalid number.

The circuit receives a 4-bit exponent E and a 4-bit mantissa M. The output flags must assert under specific conditions derived from standard floating-point behavior: * is_zero is 1 when both E and M are strictly zero. * is_inf is 1 when E is at its maximum value (all ones) and M is zero. * is_nan is 1 when E is at its maximum value and M contains at least one non-zero bit.

| E | M | is_zero | is_inf | is_nan | |-----|-----|-----------|----------|----------| | 0000| 0000| 1 | 0 | 0 | | 0000| 0001| 0 | 0 | 0 | | 1111| 0000| 0 | 1 | 0 | | 1111| 0001| 0 | 0 | 1 | | 1000| 0000| 0 | 0 | 0 |

Constraints

  • Implement using only combinational logic.
  • Do not use high-level comparison blocks: build the detection logic using primitive logic gates.

Topics

ALUCombinational LogicFloating Point

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
  • Four-Bit Bus AdderEasy
  • ALU Flag Evaluation Branch LogicHard
  • BCD Adder Correction BlockMedium
  • IEEE 754 Mantissa Alignment ShifterHard
  • 1-Bit ALU SliceMedium
  • 4-bit Carry Lookahead BlockHard
  • Debugging Twos Complement OverflowMedium

Browse all problems · Learning tracks