0% found this document useful (0 votes)
34 views22 pages

Binary Coded Decimal SUBTRACTION

Uploaded by

gicogap739
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views22 pages

Binary Coded Decimal SUBTRACTION

Uploaded by

gicogap739
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Binary Coded Decimal

(subtraction)
GROUP-2
Arshmah Ajmal | Esha Maham | Tahreem Fatima
Kinza Rizwan | Khadija
CONTENTS

1 BCD Subtraction 2 How to perform BCD Subtraction

3 Rules of BCD Subtraction 4 BCD through 2’s Complement

5 BCD through 9’s Complement 6 BCD through 10’s Complement


Binary Coded Decimal in Subtraction

• BCD subtraction is a method of subtracting two BCD numbers, where


each decimal digit is represented by a fixed number of binary bits (usually
four).

• BCD is commonly used in digital systems to represent decimal numbers in


a binary format.

• The subtraction process in BCD is similar to decimal subtraction, but it


involves considerations for borrowing and the fixed representation of digits.
How To Perform BCD Subtraction?
1. Convert Numbers to BCD: 3. Borrowing:
Convert the decimal numbers to BCD If necessary, borrow from higher-
representation. order BCD digits.

2. Subtract Corresponding Digits: 4. Check for Overflow:


Subtract each corresponding pair of If the result requires more digits than
BCD digits, starting from the rightmost the allotted space, it indicates
digit. overflow.

5. Conversion:
Convert the final BCD result back to
decimal for presentation or further use.
RULES OF BCD SUBTRACTION
1. Borrowing in BCD:

Borrowing is necessary in BCD subtraction when the subtracted digit is greater than the
subtracting digit. Borrowing in BCD is similar to decimal subtraction but is done in groups of 4
bits.

2. Handling Borrow:

When borrowing is required, subtract 1 from the higher-order BCD digit from which the borrow
is made. If the higher-order digit is 0, continue borrowing until a non-zero digit is found.

3. Adjusting for Borrow:

After borrowing, adjust the digit from which the borrow was made by adding 10 in BCD. This
compensates for the borrow.
RULES OF BCD SUBTRACTION
5. Significance of 4-Bit Groups:

In BCD, each group of 4 bits corresponds to a decimal digit. When borrowing or adjusting, it is
done on a 4-bit basis.

6. Negative Result Handling:

BCD subtraction can yield negative results. If the result is negative, it may be necessary to
handle this condition based on the requirements of the application.

7. Decimal to BCD Conversion:

Before performing BCD subtraction, ensure that the numbers are represented in BCD form.
Convert decimal numbers to BCD if needed.

8. Decimal Conversion of Result:


After obtaining the BCD result, convert it back to decimal if required for presentation or further
processing.
By 2
’s Co
mple
men
t
What is the 2's complement of subtraction?

• Decimal arithmetic uses different operations for


addition and subtraction.
• Using two’s complement, subtraction is carried
out using the machine operation for addition.
• This system works for bit strings of any length.
• The examples given will use 8 or 4 bit strings
for simplicity but a working PC is likely to use
32 or 64 bit strings.
• The first bit is used to indicate a negative value
but it is bears the position value
Example
The twos complement number 1000 1010 is
evaluated as follows:

1000 1010=
-128 + 0 + 0 + 0 + 8 + 0 + 2= - 118
Example Using a 4-bit string.
Convert 1101 (13)10 to it’s negative.

Write the number in 8-bit format 0000 1101


Invert the bits 1111 0010
Add 1 0000 0001
1111 0011
Easy to check the answer.
11110011
= -128 + 64 + 32 + 16 + 0 + 0 + 2 + 1
= - 128 + 115
= -13
By 9
’s Co
mple
men
t
What is the 9's complement method of subtraction?

9's complement subtraction steps :


 At first, find 9's complement of the B(subtrahend).
 Then add it to the A(minuend).
 If the final carry over of the sum is 1, then it is dropped
and 1 is added to the result.
 If there is no carry over, then 9's complement of the
sum is the final result and it is negative.
Example 1: 984-599

1. Take `9's` complement for `599`

Note : 9's complement of a number is obtained by subtracting all bits from 999
9's complement of 599 is
9 9 9
- 5 9 9
4 0 0
Example 1: 984-599
2. Add `984` and `400` using BCD addition

BCD code for 984 : 1001 1000 0100


BCD code for 400 : 0100 0000 0000
Addition : 1101 1000 0100
If Invalid BCD then add 6 : 0110
Addition : 10011 1000 0100
BCD value : 13 8 4
The left most bit of the result is 1, called carry and This will be added to `384`.
`384+1=385`
So final answer of BCD Subtraction is `385`
Example 2
By 1
0’s C
omp
leme
nt
What is the 10's complement method of subtraction?

10's complement subtraction steps :


 In binary subtraction, we find the 2's complement of
operand b by inverting all bits and adding a 1.
 When adding this to a you have performed a−b. In BCD
we have to find the 10's complement.
 This is done by subtracting 9 from each decimal digit (a
4 bit binary number) and adding a 1.
 The BCD Subtraction using 10s Complement can be
used to perform subtraction by adding the minuend to
the 10s Complement of the subtrahend and dropping
the carry
Consider performing the subtraction operation
(255 - 63 = 192)10
This can be considered as
(255 + ( - 63) = 192)10
Start by forming the nine’s complement of 63:
9999
- 0063
9936
Then add 1 to form the ten’s complement
9936
+0001
9937
In ten’s complement the number is positive if the left most digit
is between 0 and 4 and negative otherwise.
Example 2
ThankYou
The End

You might also like