Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

bcd substraction 36-27 ????????

Status
Not open for further replies.

genboo547

Newbie level 6
Joined
Jan 6, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,371
I want to know 36-27=9(00110110-00100111=00001001) how can we get the bcd subtraction ?
 

i know some logic so posting it..it works fine

Design a 9's Complement Generator for a BCD Digit 9's complement
The 9's complement of a decimal number is found by subtracting each digit in the number from 9
Decimal Digit 9's complement
0 9
1 8
2 7
. .
. .
. .
9 0


the 9's complement of 28=99-28=71
the 9's complement of 562=999-562=437

Subtraction of a smaller decimal number from a larger one can be done by adding the 9's complement of the smaller number to the larger number and then adding the carry to the result (end around carry). When subtracting a larger number from a smaller one there is no carry and the result in the 9's complement form is negative:

Rules

Add 9's complement of B to A

If result>9, correct by adding 0110

If most significant carry is produced (i.e.=1), then the result is positive and the end around carry must be added

If the most significant carry is 0 (no carry) then the result is negative and you get the 9's complement of the result

66_1329075450.jpg

23_1329075450.jpg


For you example
36=0011 0110
9's complement of 27 is (99-27=72)-->0111 0010
add both ---> 1010 1000//(but 1010 is greater than 1001 therefore add with 0110 but 1000 is less than 9 so add with 000)
>> (1) 0000 1000
shift this carry to LSB
you will get 00001001 (9)
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top