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

BCD Subtraction via Ten's Complement

HardLogic CircuitAnalyze

BCD arithmetic units unify addition and subtraction logic by leveraging ten's complement, mirroring the two's complement approach used in standard binary ALUs.

The operation 47 - 29 must be executed using ten's complement addition in BCD format. The subtrahend 29 is first converted to its nine's complement, then incremented by 1 to form the ten's complement. This value is added to the minuend 47 using standard BCD addition rules.

Trace the intermediate values during the complement generation, execute the raw binary addition, apply any necessary BCD corrections, and determine the final valid BCD output.

Constraints

  • All intermediate additions must follow strict binary and BCD rules.
  • Correction involves adding 0110 (6) to any decade exceeding 1001 (9) or generating a carry out to the next higher nibble.
  • The system is limited to two BCD digits. Any carry out of the most significant digit is an end carry.

Topics

arithmeticbcdtens-complementlogic-design

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

  • Binary to HexEasy
  • 1-to-4 Demultiplexer from AND and NOT GatesEasy
  • 2-to-4 Line Decoder with Active-High EnableEasy
  • Hex Nibble to BinaryEasy
  • Odd Parity Bit Generator for 3-bit DataEasy
  • Full Adder from Half AddersEasy
  • Modulo ArithmeticMedium
  • Two's Complement: Encode a Negative DecimalEasy

Browse all problems · Learning tracks