Designing 8-bit Binary to BDC Converter

In summary, the conversation discusses the design and implementation of an 8-bit binary to BCD converter using only ICs. The OP has an algorithm called the double dabble method which works for converting the binary to BCD, and is considering using comparators and a 4-bit adder for the design. The conversation also explores the possibility of simplifying the design using mapping techniques and finding values greater than a fixed threshold. It is noted that this is a school project and the OP must do the majority of the work.
  • #1
kriegsmachine
5
0
Designing 8-bit Binary to BCD Converter

I have to design and implement an 8-bit binary to BCD converter **using only ICs**

I have an algorithm that works just fine in converting an 8-bit binary to BCD that can be sent to three 7-segment displays. It is called the double dabble method. Please look at the Wiki article below if you don't know what this is because you will be lost with my method if you are not familiar.

http://en.wikipedia.org/wiki/Double_dabble" [Broken]

I have a series of 10 D FFs hooked up as a serial shift register. I have a parallel in, serial out shift register before the 10 D FFs so I can load the 8-bit number and then progressively shift it as needed by the double dabble method.

The first 4 FFs represent the 1's place, the next 4 represent the 10's place and the last 2 FFs are for the 100's place (only 2 because the hundreds place can only go as high 2).

I am thinking of setting up comparators to the 1's and 10's place FF outputs and tying one of each comparator's inputs to binary 0100 (4 in decimal) to see when the number in the 1's and 10's place is greater than 4. When that is the case, I want to use use that (A>B) output to add 3 (0011) to whatever number is in the place in question (1's or 10's). I can do this with a 4-bit adder.

Now is where I am getting lost. I want to some how use the output of the comparator to take the sum of the 4-bit adder and put that BACK INTO the place of the original number (back INTO the D FF's). Can I somehow do this with the Preset and Clear?

And what about timing? This is all done with a clock.

I know this is probably confusing without seeing a schematic, so I am sorry for that. Any help or suggestions are GREATLY appreciated.
 
Last edited by a moderator:
Engineering news on Phys.org
  • #2
kriegsmachine,

Are you required to use the double dabble algorithm for your design? It seems overly complex for this purpose. The binary->BCD converter is just an arbitrary 8-input, 21-output function. It is purely combinational, and you can use something like a Karnaugh map to determine its simplest form.

- Warren
 
  • #3
No I am not, but I looked into the Karnaugh map idea and that seemed like I would need far too many chips for it to be practical.

I don't see why I would need 21 outputs. There are 8 inputs, and 4 outputs for each 7-segment display. Thats a total of 12 outputs. Minus the two MSBs on the 100's place display, leaving 10 outputs.

I set up a truth table listing all numbers 0-255 in binary form and used a Java program to simplify them. It wasn't pretty.

Just as an example my 5th output (2's place on 10's 7-seg display) simplified to:


( A'. B'. C'. D . F ) + ( A'. B'. C'. D . E ) + ( B'. C . D'. E') + ( A'. B . C'. D') + ( A'. B . C . D . E ) + ( A . B'. D'. E') + ( A . B'. D'. F') + ( A . B'. C . E'. F') + ( A . C . D') + ( A . B . C'. D . E . F ) + ( A'. B'. D . E . F )

With 'A' being the MSB and 'H' the LSB of the binary input.
 
  • #4
Chroot was right that using the Double Dabble approach would be complicated, if conventional thinking is employed; however, some shortcuts may be possible. I’ve noted a couple of possible provisions, using the Double Dabble approach whereby the process appears to become much simpler - - if mapping is carefully used. I’m going to test the ideas to see if they work the way I expect that they will. As an example, it should be noted that a full-fledged comparator isn’t required because you don’t to make general compares. Rather you simply need to find a small number of values greater than a fixed threshold - - perfect for mapping. The same goes for the add. In fact, through proper mapping the add and the compare can just about be combined into something much simpler. I intend to test my observations to see if it is as I expect. I expect to get back with you when I have done so.

KM
 
  • #5
Kenneth Mann said:
Chroot was right that using the Double Dabble approach would be complicated, if conventional thinking is employed; however, some shortcuts may be possible. I’ve noted a couple of possible provisions, using the Double Dabble approach whereby the process appears to become much simpler - - if mapping is carefully used. I’m going to test the ideas to see if they work the way I expect that they will. As an example, it should be noted that a full-fledged comparator isn’t required because you don’t to make general compares. Rather you simply need to find a small number of values greater than a fixed threshold - - perfect for mapping. The same goes for the add. In fact, through proper mapping the add and the compare can just about be combined into something much simpler. I intend to test my observations to see if it is as I expect. I expect to get back with you when I have done so.

KM

Please keep in mind that this is schoolwork, so if you solve the OP's problem, that would violate the PF rules.

We are allowing this thread to stay in EE for now, because it is project-oriented, but it is still the OP's schoolwork, so s/he must do the bulk of the work. So you can offer hints (as you have done so far), and ask probing questions, and find errors, but please do not post a solution or do the OP's schoolwork for them. Thanks.
 
  • #6
kriegsmachine said:
No I am not, but I looked into the Karnaugh map idea and that seemed like I would need far too many chips for it to be practical.

I don't see why I would need 21 outputs. There are 8 inputs, and 4 outputs for each 7-segment display. Thats a total of 12 outputs. Minus the two MSBs on the 100's place display, leaving 10 outputs.

I set up a truth table listing all numbers 0-255 in binary form and used a Java program to simplify them. It wasn't pretty.

Just as an example my 5th output (2's place on 10's 7-seg display) simplified to:


( A'. B'. C'. D . F ) + ( A'. B'. C'. D . E ) + ( B'. C . D'. E') + ( A'. B . C'. D') + ( A'. B . C . D . E ) + ( A . B'. D'. E') + ( A . B'. D'. F') + ( A . B'. C . E'. F') + ( A . C . D') + ( A . B . C'. D . E . F ) + ( A'. B'. D . E . F )

With 'A' being the MSB and 'H' the LSB of the binary input.

Are you allowed to use a PAL or CPLD for the logic implementation? That would make it much more practical (and better practice for you) than implementing this with discrete SSI chips. Can you estimate what size CPLD / FPGA you would need to implement this?

Also, how do you drive a 7-segment display with 4 outputs?
 
  • #7
I only have access to 7400 series TTL chips. I have a new idea and I think it will work, but it seems almost too easy.

I plan on loading two stringed 4-bit binary counters with the 8-bit binary. Then counting down on those until zero is reached, meanwhile using 3 decade counters to count up from zero. Each will be connected to the same clock. When the binary counters reach zero, the decade counters will have reached the correct number.
 
  • #8
berkeman said:
Please keep in mind that this is schoolwork, so if you solve the OP's problem, that would violate the PF rules.

We are allowing this thread to stay in EE for now, because it is project-oriented, but it is still the OP's schoolwork, so s/he must do the bulk of the work. So you can offer hints (as you have done so far), and ask probing questions, and find errors, but please do not post a solution or do the OP's schoolwork for them. Thanks.

Thanks for the "heads up". I certainly don't intend to violate the rules, and will not post answers here - - just possibly suggestions, and how I have progressed. (Actually, I cannot post diagrams here, even if I wanted to.)

KM
 
  • #9
Kenneth Mann said:
Thanks for the "heads up". I certainly don't intend to violate the rules, and will not post answers here - - just possibly suggestions, and how I have progressed. (Actually, I cannot post diagrams here, even if I wanted to.)

KM

No worries.

kriegs lastest idea seems pretty creative -- what do you think of it? I think there are some init/clocking issues, but they seem to be not too bad. (Like how often to do the init/clocking/latching cycle)
 
  • #10
I was thinking of OR-ing together the 8 outputs of the binary counters, so when they all reach zero the output of the OR gate is zero. Take that signal and AND it with the clock pulses and we have a stopping mechanism.

I'm going to try my ideas later, so I will post the results sometime soon.
 
  • #11
All set. I built my idea, only took about 30 minutes and it works perfectly. I just cranked up the clock speed to 10 kHz so the display updates seemingly instantly. Thanks for the help everyone.
 
  • #12
berkeman said:
No worries.

kriegs lastest idea seems pretty creative -- what do you think of it? I think there are some init/clocking issues, but they seem to be not too bad. (Like how often to do the init/clocking/latching cycle)

Very clever. Rather than trying to convert, just recount the value. It will definitely work, though I'm not exactly sure what the instructor might think of it. Imagine the time to convert 32-bit numbers.

By the way; I tested what I described earlier and it works perfectly (after numerous assembly miscues have been solved). By mapping, a direct converter is constructed, which eliminates almost all of the adder and comparator circuitry; it only requires mapping using truth tables derived from the initial count list to the intended (add three) count list. I would suggest that kriegsmachine look through https://www.physicsforums.com/showthread.php?t=100628".

KM
 
Last edited by a moderator:
  • #13
Are you allowed to use the full range of 7400 series devices or are you restricted to using certain ones?
 

1. What is an 8-bit binary to BCD converter?

An 8-bit binary to BCD (Binary-Coded Decimal) converter is a digital circuit that converts an 8-bit binary number into its corresponding BCD representation. This is useful in digital systems where data needs to be displayed or processed in BCD format.

2. How does an 8-bit binary to BCD converter work?

An 8-bit binary to BCD converter works by breaking down the 8-bit binary number into groups of 4 bits, and then converting each group into its corresponding BCD representation using logical operations such as AND, OR, and XOR. The resulting BCD digits are then combined to form the final BCD output.

3. What are the applications of an 8-bit binary to BCD converter?

An 8-bit binary to BCD converter is commonly used in digital systems such as calculators, digital clocks, and microcontrollers. It is also used in data processing and storage systems where BCD format is preferred for its simplicity and ease of conversion.

4. What are the limitations of an 8-bit binary to BCD converter?

One limitation of an 8-bit binary to BCD converter is that it can only convert numbers in the range of 0-255. Numbers outside of this range will result in an error. Additionally, the conversion process can be time-consuming and may require more complex logic circuits for larger bit numbers.

5. How can I design an 8-bit binary to BCD converter?

To design an 8-bit binary to BCD converter, you will need knowledge of digital logic circuits and Boolean algebra. The design process involves breaking down the conversion process into smaller steps, designing the necessary logic circuits for each step, and then combining them to form the final converter. There are also various online resources and tutorials available to guide you through the design process.

Similar threads

  • Electrical Engineering
Replies
17
Views
2K
Replies
4
Views
787
  • Electrical Engineering
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
639
  • Programming and Computer Science
Replies
3
Views
923
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Electrical Engineering
Replies
6
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
4K
Replies
1
Views
1K
  • Electrical Engineering
Replies
5
Views
2K
Back
Top