Understanding Binary Multiplication with a 7 Segment Display: A Beginner's Guide

  • Thread starter shoukisuke
  • Start date
  • Tags
    Binary
In summary: The output should be in decimal. The shift register in the illustration "shifts" the bits in the flip flops to the right every time the registers are clocked (reads D into Q). This is is equivalent to multiplying by 2. Two shifts is equivalent to multiplying by 4.
  • #1
shoukisuke
8
0
Shifting up from binary URGENT!

Hi, I have a project that requires me to multiply a digital input by 2 and 4. Every website I've looked at keeps telling me to "shift it up 2 bits". I know how that works theoretically, ie. adding a 0 after the binary number would be multiplying it by 2. But how exactly does that work with the circuit? And where do we do it? I'm using 7 segment display, btw.

- Thanks in advance.
 
Physics news on Phys.org
  • #2


Hi shoukisuke-

Hopefully your project is using hexidecimal (scale of 16) and not decimal (scale of 10). The following applies only to hexidecimal.

Read http://www.electronics-tutorials.ws/sequential/seq_5.html

The shift register in the illustration "shifts" the bits in the flip flops to the right every time the registers are clocked (reads D into Q). This is is equivalent to multiplying by 2. Two shifts is equivalent to multiplying by 4.

Bob S
 
  • #3


Suppose you have a number X stored in a register. The register would consist of, say, n D flip-flops. Let's label them FF0, FF1, ..., FFn-1, where FF0 corresponds to the least-significant bit of X, and FFn-1 to the most-significant bit. If you want the number 2X stored in the register, you'd set the input of FF0 to 0 and the input of FFi to the output of FFi-1. On the next clock cycle, 2X would be loaded into the register. Make sense?
 
  • #4


Yes, now I get that. Hmm but do you know how to convert 8 bit to 12 bit? Right now, I seem to understand how to do the shift part. But after the multiplying, I get an 8 bit input, and I need 12 bit for the 7-seg display. Do you know how to convert this with an ic?
 
Last edited:
  • #5


Thanks for the quick reply, Bob. Right now, I seem to understand how to do the shift part. But after the multiplying, it's an 8 bit input, and I need 12 bit for the 7-seg display. Do you know how to convert this with an ic?
 
  • #6


I'm not sure what you're asking. Can you explain the problem in a bit more detail?
 
  • #7


I am counting heartbeats. The time settings are 15s and 30s, so I need to multiply by 2 and 4 depending on the setting the user chooses. So far, I got the sensor part to work , and my counter outputs an 8 bit signal. We need to output the bpm to the 3 7-segment LEDs we have, which requires a 12 bit output. What I'm wondering is, how to convert the 8 bit signal to the 12 bit output.

-Thank you
 
  • #8


Presumably, you want the output in decimal, so I see a problem. If your counter represents the number in binary, you need to somehow convert it to decimal digits so you know how to drive each digit in the display. On the other hand, you could use a decimal counter, but that complicated the multiplication. Of the two approaches, I think the latter is preferable because you can avoid the need to multiply by being clever, but then again, I don't know what types of ICs you have available.
 
  • #9


What kind of IC would you need to convert the binary to decimal? We're allowed to use any kind of IC's as long as it's not programmable...
 
  • #10


shoukisuke said:
Thanks for the quick reply, Bob. Right now, I seem to understand how to do the shift part. But after the multiplying, it's an 8 bit input, and I need 12 bit for the 7-seg display. Do you know how to convert this with an ic?
Your data needs to be in binary (hexidecimal) format (NOT BCD (binary coded decimal) format).

Look at the 4-bit register in http://www.electronics-tutorials.ws/sequential/seq_5.html

The Q outputs of the individual flip flops in the shift register are attached to a 4-line to 7-segment decoder like

http://www.datasheetcatalog.org/datasheet/motorola/MC14495P1.pdf

Look at the 4-line hexadecimal to the 7-segment decoder truth table in the lower right corner of the first page.

hex display for 0 to 16 is: 0 1 2 3 4 5 6 7 8 9 A B C D E F



Bob S
 
  • #11


My point is that there's probably some IC available somewhere for taking binary input and driving a 7-segment display. If you can find one, your problem is solved, but I'd guess that that's not what your instructor intended.
 
  • #12


Is the output supposed to be in decimal or not? I'm inferring it does as you said you have a three-digit display.
 
  • #13


@bob: I have an 8 bit binary number from the counters. I shift the 8 bit binary number using an 8 bit shift register and I have an 8 bit binary number that is multiplied by two. How do I get a 12 bit number so I have a 4bit input for each decoder of the 3 x 7segment displays? I read your post and i don't understand how it converts 8bit to 12 bit. You suggest that I just shift it and then just put it into a decoder.

@vela: Yes, 12-bit decimal.
 
Last edited:
  • #14


shoukisuke said:
You suggest that I just shift it and then just put it into a decoder?
Yes. For an 8 bit register, you need two hexadecimal to 7 segment decoders side by side, each decoding 4 segments. If you have a 12 bit shift register, use 3 hex to 7 segment decoders.

Bob S
 
Last edited:
  • #15


shoukisuke said:
@vela: Yes, 12-bit decimal.
This is a critical piece of information. Bob was assuming, as he said in his first post, that you're using only hexadecimal, not decimal.

If I were you, I'd go with a BCD counter instead of a binary counter.
 
  • #16


@bob: Wouldn't using only 2 hexadecimal only output 2 displays for the 7-segment LED?
 
  • #17


shoukisuke said:
@vela: Yes, 12-bit decimal.
Just to clarify, if your heart rate is 64 beats per minute, do you want the display to read 064 or 040 (which is the representation of 64 in hexadecimal)?
 

FAQ: Understanding Binary Multiplication with a 7 Segment Display: A Beginner's Guide

1. What is binary multiplication?

Binary multiplication is a method of multiplying two binary numbers, which consist of only 0s and 1s, to get a product. It follows the same principles as traditional multiplication, but only involves two digits, 0 and 1.

2. How does a 7 segment display represent binary numbers?

A 7 segment display is composed of 7 segments that can be turned on or off to represent different numbers. In binary, each segment corresponds to a specific power of 2, with the rightmost segment representing 1, the second from the right representing 2, and so on. By turning on specific segments, the display can represent any binary number from 0 to 7.

3. Why is understanding binary multiplication important?

Binary multiplication is the basis for many calculations in computer science and digital electronics. It is also essential for understanding how computers store and process data. Without a good understanding of binary multiplication, it can be challenging to work with binary numbers and perform calculations in these fields.

4. How do you perform binary multiplication using a 7 segment display?

To perform binary multiplication using a 7 segment display, you first need to convert the binary numbers into their decimal equivalents. Then, multiply the two decimal numbers as you would in traditional multiplication. Finally, convert the result back to binary and use the 7 segment display to represent the product.

5. Are there any limitations to using a 7 segment display for binary multiplication?

Yes, there are limitations to using a 7 segment display for binary multiplication. The display can only represent numbers from 0 to 7, so larger products cannot be displayed. It also does not allow for carrying or borrowing, which may be necessary for more complex multiplication problems. Additionally, it can be challenging to read and interpret the results accurately, especially for beginners.

Similar threads

Replies
14
Views
4K
Replies
1
Views
2K
Replies
9
Views
12K
Replies
2
Views
4K
Replies
1
Views
5K
Replies
6
Views
1K
Back
Top