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.

Binary to BCD conversion

Status
Not open for further replies.

curme03

New Member
Hello, can everyone help me? im having problem with my HM... I already have equation from the k-map and connected in the flip flop which is in the green box in the picture.... my problem is that i do really have to do another circuit? which is located in the yellow box in order to convert the binary to bcd then i will connect it to the 7448.... I used two 7448 and two seven segment common cathode... lets say we have to output even to odd 0,2,4,6,8....15. Thank you in advance...

View attachment 65603
 
Last edited:
You could use a microcontroller to implement the "double dabble" algorithm (google for it), or do it in hardware since you only have 4 bits.

Or since you are only counting up to 15 you could use a set of logic gates to synthesise the two bcd outputs - numbers 0-9 (0000 to 1001) go straight through to low digit, numbers higher than this set high digit to 1 (0001) and create numbers 0-5 on low digit instead.

Since you are only interested in displaying a 0 or 1 (or even, blank or 1) on the high digit, you actually don't need 2 decoders - you could hardwire the appropriate segments to give you what you want on that one.

Either way, it doesn't look straightforward.

I'm sure someone else can give you far better advice, but it's food for thought I hope.
Have fun :D
 
Hi,

If you can post the problem clearly, I think I have notes on these. However, I still don't know if it fits to what you need my friend since I could not understand the requirements very clearly. This part

lets say we have to output even to odd 0,2,4,6,8....15.

is also vague for me.

m8
 
Hi Curme,
I thought 4 bit binary was BCD. Depends what u r doing cos mostly for 7 segment u dont want values over 9 to do anything with the 7 segment display. There's heaps of bcd to 7 segment IC packages to do what u want.
maybe as meow says;"If you can post the problem clearly...."
rumpfy.
 
4 bit binary is not bcd, since you can count to 15 with 4 bits. With bcd you need to stop counting at 9 and carry into the next digit for the numbers 10 to 99 - in other words each decimal digit is represented as a binary number - so 0000 to 1001 is allowed, 1010 and above must create a carry.
binary 0 to 15 = 0000 to 1111
bcd 0 to 15 = 0000 0000 to 0001 0011

There's no easy way to do it with gates unless you are dealing with a very limited range of numbers, as the OP is. Actually, a quick google turns up data for the 74185 chip - looks pretty old though. https://www.google.co.uk/url?sa=t&r...fEnB94e9oQShmICmg&sig2=JRky6WwhCSk4UcjS3l5QdA. It's actually based on a rom chip.

Hope this helps.
 
Hi Curme,
I thought 4 bit binary was BCD. Depends what u r doing cos mostly for 7 segment u dont want values over 9 to do anything with the 7 segment display. There's heaps of bcd to 7 segment IC packages to do what u want.
maybe as meow says;"If you can post the problem clearly...."
rumpfy.
4 bit binary is not necessarily BCD but the 4-bit binary values of 0-9 are BCD.

Speaking of posting the problem clearly, the text-speak in your post makes it hard to read. :rolleyes:
 
Hi,

Since your problem (I think :p) is mainly on how to convert the four bit binary to Binary Coded Decimal, here's my idea.

Code:
0000
0001
0010
0100
0101
0110
0111
1000
1001

A3 A2 A1 A0
 1  0  1  0
 1  0  1  1
 1  1  0  0
 1  1  0  1
 1  1  1  0
 1  1  1  1

If you can inspect from the four bit binary labeled above as A3 A2 A1 and A0,
this equation might be useful:

Y=A3*A2 + A3*A1

If Y=1, you must add "0110" to get the correct BCD form.
You may try substituting the values we have above for you to verify the equation.
In adding '0110', you may use 'full adders'.

m8
 
Last edited:
I Goggled the "Double Dabble" algorithm. First hit..What a complex method in C.

sprintf it to a string and extract the digits from the string.
 
I'd never heard of a k-map before and I found it on wikipedia - looks horribly complicated and mathematical - don't understand at all! I can cope with truth tables...
 
I'd never heard of a k-map before and I found it on wikipedia - looks horribly complicated and mathematical - don't understand at all! I can cope with truth tables...

Only if you find a good website to show it, it's not actually complicated. It will reduce the normal equation you get on your truth table. It's a pretty helpful staff. You only need to inspect 1's and 0's and variables may be eliminated,hence,reducing the equation.

m8
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top