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

Fixed Point Rounding Logic

HardLogic CircuitBuild

Digital signal processing pipelines require word length reduction after multiplication operations. Simple truncation introduces a systematic negative bias into the signal, requiring round-to-nearest logic to maintain mathematical accuracy.

The circuit takes an 8-bit input din and produces a 4-bit output dout. The upper four bits din[7:4] represent the integer portion to be kept. The lower four bits din[3:0] represent the fractional portion to be discarded. Implement round-to-half-up logic: conditionally add one to the least significant kept bit based on the value of the most significant discarded bit.

| din | dout | |----------|--------| | 01010000 | 0101 | | 01010111 | 0101 | | 01011000 | 0110 | | 11111000 | 0000 |

Constraints

  • Combinational logic only.
  • Ignore overflow carry bits beyond the 4-bit output width.

Topics

fixed-pointdsprounding

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