When two BCD numbers 0x14 and 0x08 are added, what is the binary…

2013

When two BCD numbers 0x14 and 0x08 are added, what is the binary representation of the resultant number? ISRO 2013

  1. A.

    0x22

  2. B.

    0x1c

  3. C.

    0x16

  4. D.

    Results in overflow

Attempted by 198 students.

Show answer & explanation

Correct answer: A

In packed BCD (8421) representation, each 4-bit nibble encodes one decimal digit from 0 to 9; a nibble value of 10 to 15 is invalid. Ordinary binary addition of two digit nibbles can land in that invalid range, so whenever a digit-pair sum exceeds 9 (or produces a binary carry-out), the BCD correction rule adds 0110 (6) to roll that digit over into a valid digit plus a carry into the next digit position.

  1. Split each operand into its BCD digit nibbles: 0x14 gives digits (1, 4); 0x08 gives digits (0, 8).

  2. Add the lower digits: 4 + 8 = 12, i.e. binary 1100.

  3. 1100 (12) exceeds the valid BCD range of 0-9, so add the correction 0110 (6): 1100 + 0110 = 1 0010. This gives a corrected lower digit of 0010 (2) with a carry of 1 into the upper digit.

  4. Add the upper digits plus the carry: 1 + 0 + 1 = 2, i.e. binary 0010, which is already within 0-9, so no further correction is needed.

  5. Combine the corrected digits in order, upper then lower: 2 and 2, giving the packed-BCD result 0x22, i.e. binary 0010 0010.

Cross-check with plain decimal arithmetic: 0x14 and 0x08 as packed BCD represent the decimal values 14 and 08. Adding them normally gives 14 + 8 = 22, which packs back into the BCD digits 2 and 2, i.e. 0x22, matching the nibble-level correction above.

Explore the full course: Rssb Basic Computer Instructor

Loading lesson…