Floating Point Exception Flags
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_zerois 1 when bothEandMare strictly zero.is_infis 1 whenEis at its maximum value (all ones) andMis zero.is_nanis 1 whenEis at its maximum value andMcontains 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
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.
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.
Part of Arithmetic and ALU Design
Problem 30 of 32 in the Arithmetic and ALU Design track.
Related problems
Browse all problems · Digital logic design practice problems · Learning tracks