What is BCD Subtraction in Computer Architecture?

Computer ArchitectureComputer ScienceNetwork

A subtractor circuit is required to perform a subtraction operation on two decimal numbers. BCD subtraction is slightly different from BCD addition. Performing subtraction operation by taking the 9’s or 10’s complement of the subtrahend and adding it to the minuend is economical.

It is not possible to obtain the 9’s complement by complementing every bit in the code because the BCD is not a self- complementing code. The 9’s complement has to be formed by a circuit that subtracts Notes every BCD number from 9.

The 9’s complement of a decimal digit that is represented in BCD can be obtained by complementing the bits in the coded representation of the digit. There are two methods of correction are as follows −

First Method − The binary 1010 is added to every complemented digit. The carry is discarded after performing the addition.

Second Method − The binary 0110 is added before the digit is complemented.

For instance, the 9’s complement of BCD 0111 is calculated by complementing every bit to get 1000. The value 0010 is obtained by adding binary 1010 and ignoring the carry. Using the second method, 0110 and 0111 can be added to obtain 1101. The required output, that is, 0010 can be obtained by complementing every bit.

Complementing every bit of a 4-bit binary digit N is the same as subtracting the digit from 1111. When the decimal equivalent of 10 is added, the value obtained is 15 - N + 10 = 9 - N + 16.

However, the digit 16 signifies the carry that is discarded, hence, the result equals 9 - N as required. Adding and then complementing the binary equivalent of decimal 6 provides 15 - (N + 6) = 9 - N as needed.

A combination circuit can also be used to obtain the 9’s complement of a BCD digit. When this combination circuit is attached to a BCD adder, it results in a BCD adder or subtractor.

Published on 30-Jul-2021 13:20:20