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.

9s complement of BCD digit

Status
Not open for further replies.

samina

Member
i have to design a combinational circuit which would generate 9s complement of a BCD digit.

if i subtract the digit from 9, i will get the output. but i dont know what to use for subtraction.

do i need to use any terminal for carry operation

hope to get help from u?
 
hi eric,
I know the process, but i need to design a circuit which will do the operation
can u suggest anything about that
 
Hi,


What you could do is look at the ALU TTL chips and see what you can get from the data sheet. It's possible to use gates to do this, but
you'll need to look at how it is done and those chips might help. Of course if you use those chips directly that's even easier.
One ALU chip part number is 74181.

Another possibility is to use 1 bit adders after taking the 2's complement of the number. One part number is 74183 but you could make your own.

Still yet another possibility is to use a method sometimes called the 'tare' method. This involves a set of pre-settable up/down counters where you load the number to be subtracted from into the counters (minuend) first, then pulse 'down' the entire count of the number to be subtracted. If another set of counters is used to store the subtrahend, the first set can be pulsed while the second set is also pulsed and when the second set gets to zero stop the pulsing and extract the result from the first set.
Using a high frequency this can be fast, but it will of course be slower for a large number of BCD digits.
For example, if you want to subtract '8' from '9' you load the first counter with '9' and the second counter with '8'. Then, start pulsing 'down' both counters until the second counter reaches zero. At that point the first counter will contain '1', the result.
 
Last edited:
You don't need to do a subtraction; just design the truth table the other way round:

abcd 0123456
0000 1111011 - instead of 1111110 (i.e. display 9 instead of 0)
0001 1111111 - instead of 0110000 (8 instead of 1)
..etc
So for an input of 0000 the output would be 9, for 0001 8, 0010 7 and so on. Then from the truth table work out an appropriate arrangement of gates for segments 0-6.

Or if you already have a BCD decoder and you need to add some glue logic to subtract then just do the truth table for that:

abcd a'b'c'd'
0000 1 0 0 1
0001 1 0 0 0
0010 0 1 1 1
etc
d' is just not-d, of course. From these 3 lines it looks as if c' might equal c. There'll be more to a' and b'.
Then feed a'b'c'd' into the decoder instead of abcd.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top