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

BCD Ten's Complementer

HardLogic CircuitBuild

Financial systems and digital instrument panels process numbers directly in Binary-Coded Decimal to prevent precision loss. Subtraction in these architectures relies on ten's complement arithmetic rather than standard binary two's complement.

The circuit must compute the ten's complement of a 4-bit BCD digit A. This requires finding the nine's complement (9 minus A), then adding 1. If the result reaches 10, the output Y must wrap around to 0 and assert the carry out signal Cout. Assume the input will always be a valid BCD digit.

| A | Y | Cout | |-----|-----|--------| | 0 | 0 | 1 | | 1 | 9 | 0 | | 2 | 8 | 0 | | 3 | 7 | 0 | | 4 | 6 | 0 | | 5 | 5 | 0 | | 6 | 4 | 0 | | 7 | 3 | 0 | | 8 | 2 | 0 | | 9 | 1 | 0 |

Constraints

  • Implement using combinational logic only.
  • Do not use high-level binary subtraction blocks: construct the BCD-specific logic.
  • Treat input values greater than 9 as don't cares.

Topics

CombinationalArithmeticBCD

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