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

BCD Adder Correction Block

MediumLogic CircuitBuild

Arithmetic pipelines processing human-readable data rely on Binary-Coded Decimal representations. Standard binary adders produce invalid hex characters when a digit sum exceeds nine, requiring a dedicated correction stage to restore base-10 validity.

The circuit receives a 4-bit input sum S and a 1-bit flag. When flag is 1, the circuit adds 6 (binary 0110) to S. When flag is 0, S passes through unmodified. The circuit outputs the corrected 4-bit sum Y and any resulting carry out Cout.

| flag | S | Y | Cout | |--------|-----|-----|--------| | 0 | 5 | 5 | 0 | | 0 | 9 | 9 | 0 | | 1 | 0 | 6 | 0 | | 1 | 10 | 0 | 1 | | 1 | 15 | 5 | 1 |

Constraints

  • Combinational logic only.
  • Implement using standard logic gates and adders.

Topics

adderbcdcombinational-logic

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

Browse all problems · Learning tracks