Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

BCD adder/subtractor

Status
Not open for further replies.

synckewl

New Member
Hi guys,
I found the schematic diagram for BCD adder.
I wonder how can I do BCD subtraction?
I tried to get the 2's complement of the neg num and add onto the first value but the ans doens't seem correct.
Or I need to convert every bits to binary and do subtraction?:confused:

Thank in advance
 
You need to take the 10's complement to do BCD subtraction. To take the 10's complement you take the nines complement and add 1.
 
Papabravo said:
You need to take the 10's complement to do BCD subtraction. To take the 10's complement you take the nines complement and add 1.

wow :eek:

first time I heard of 10's complement.

how do we do it?

eg: 83 - 74
Code:
  1000 0011
- 0111 0100
?
 
The 9's complement of 74 is 25. Note that 74 + 25 = 99
To get the 10's complement you add 1, so 25 plus 1 is 26
Now add ignoring the carry from the 10's place
83 + 26 = 09 = 83 - 74
Right?
 
Papabravo said:
The 9's complement of 74 is 25. Note that 74 + 25 = 99
To get the 10's complement you add 1, so 25 plus 1 is 26
Now add ignoring the carry from the 10's place
83 + 26 = 09 = 83 - 74
Right?

ic, but how do we do it in circuit view?
I actually need to build a BCD adder and subtracter project.
I know the adding part but the subtractor part I am still confused.

Is there any schematic diagram for BCD adder/subtractor as well? Thanks
 
I don't know. In 44 years of hardware design I've never had to implement a BCD subtractor. To take the 9's complement you can use a PROM lookup table or you can use a PAL to implement the boolean equations for the following table

0 -> 9
1 -> 8
2 -> 7
3 -> 6
4 -> 5
5 -> 4
6 -> 3
7 -> 2
8 -> 1
9 -> 0

The add one part is easy -- always enable the carry in to the adder.
 
Though I am new to this, but is it possible to implement a binary subtractor and then based on a correction logic to generate an equivalent BCD code for the binary code.I think the normal C=K+Z8.Z4+Z8.Z2 correction logic should work here too.So implementing a 4 bit binary subtractor is the only part that needs to be done.Does that sound correct?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top