Binary Multiplication to Represent 0-359 on 3 7-Seg Displays

In summary: You will want to use BCD I guess, in any case you will need 2 bytes that would allow you to display up to 4 digits with 1.4 multiplication. You will also need a binary multiplier to help with the number conversion.
  • #1
ProPatto16
326
0

Homework Statement



i have an 8 bit input, and i need to represent 0-359 in decimal on 3 7-seg displays


The Attempt at a Solution



with 8 bits there is only 256 possibilities so the input would have to be multiplied by 1.4 to get an even spread over 259 degrees.
but you can't multiply a binary number by a floating number and then if you have a result of say 345 how do you represent it with 8 bits.

so i need to find a way to take 8 bits and represent numbers from 0-359. doesn't need to be every degree .
and have to simulate it in multisim so can't use binary rate multipliers.

any ideas? just somehwere to start looking.
 
Physics news on Phys.org
  • #2
Hi ProPatto16
You could multiply by 14 and divide by 10 :)
You are going to use BCD I guess, in any case you will need 2 bytes that would allow you to display up to 4 digits
So pretend you have 4 digits and whatever number you have to itself 13 times, and carry up to the second byte
At the end, you just ignore your last digits (the second nibble of your first byte)
Cheers...
 
  • #3
Good idea! Thanks,
Just another issue, multisim has no binary multiplier so I'm going to have to make one out of JKs which is fine, but what other ICs would I need to get from the original 8-bit input to the 3 displays? Cause ill need to design them from scratch too. But that'll get me on the right track
 
  • #4
Hi, sorry I don't know about ICs, I am not into electronics, I just have some memories about it but they are quite old :)
Anyway, multiplication is hard, I think you can avoid it by just doing addition, you just need to do 13 additions, it should be fast.
Once the additions are done, you convert to BCD if it is easy enough, I remember it is a standard way to work and there are plenty of ready to use algorithms / ICs to go from BCD to 7 segs displays
you should find yourself with 2 bytes encoding in BCD a 4 digits number, (the 4 nibbles) you just discard the last nibble and wire everything else and it should do the trick
Cheers...
 
  • #5
To do this exactly, you need to multiply by 45, then divide by 32 (shift right 5 bits). You could create a translation table (like a rom), using the 8 bit input shifted left 2 bits to index the table to get 32 bits, using 21 bits of that for the three 7 segment displays.
 
  • #6
Yeah I gave up on the multiplier and made an 8x8 adder. It's a beast. I just can't get the 9th bit to work when I add 2 large 8 bits and get a 9th bit to make a number over 255. I thought I just put the last carry out as the 9th bit so when there's carry it'll be high ?
 
  • #7
Why not make a 14 bit adder? This will be large enough to multiply by 45. Then you need a second register to hold intermediate sums. Assuming the original value O is in X and using A... for the intermediate sums:

Code:
A = X + X    (A = 2 O)
A = A + A    (A = 4 O)
X = A + X    (X = 5 O)
A = X + X    (A = 10 O)
A = A + X    (A = 15 O)
X = A + A    (X = 30 O)
X = A + X    (X = 45 O)
X = X + 16   (round X before shifting)
X >>= 5      (use upper 9 bits of X)

You've still got the problem that you now have to convert this to decimal for the three 7 segment displays. As mentioned before, you could just create a 256 entry by 12 or 21 bit table and let multisim figure it out.
 
Last edited:
  • #8
Doesn't need to be perfect. Just going to round the decimal off and show whole numbers so it'll go like 0,1,3,4,5,7,8,9,11,12,14 type thing
 
  • #9
Did you ever resolve this? I have to do a multiplication as well, but am a little overwhelmed by the complexities of it all.
 
  • #10
I figured out the multiplier but havnt done the division. If you look at how binary numbers are multiplied and then add those combinations. Whatever your multiplicand is like 2 bits 3 bits 4 bits, then youll need one less adders. So for 4 bits you need 3 adders. Go do some multiplication the long way and you'll see if you multiply by a 4 bit number you'll get 4 additions before the last result. Put those 4 additions through adders
 
  • #11
Thanks for that. I've actually had some success with adders.
As for the division, couldn't you simply disregard the 'divide by 10'? After all, in 7-segment displays, that division would represent the decimal place. Does your project need that level of precision?
 
  • #12
As far as I can figure out all this divide by 10 stuff is for frequency not for binary numbers. So i start with say 25 and between 0-359 the 25th number is actually 35. to get 35 from 25 multiply by 14 to get 350 and then divide by 10 then display it. I don't need decimals at all, only displaying whole numbers. So I'm looking at shift registers to try turn that 350.0 into 35.00.
 
Last edited:

What is binary multiplication?

Binary multiplication is a mathematical operation that involves multiplying two binary numbers. It follows the same rules as traditional multiplication, but with the added constraint that all digits must be either 0 or 1.

How does binary multiplication represent numbers on 3 7-segment displays?

By using binary multiplication, we can represent numbers from 0 to 359 on 3 7-segment displays. Each 7-segment display has 7 segments, which can be turned on or off to create different combinations. By multiplying binary numbers, we can turn on the necessary segments to display the corresponding number.

Why do we use 3 7-segment displays for binary multiplication?

Using 3 7-segment displays allows us to represent numbers up to 359, which is the maximum value that can be displayed using 3 digits. This is because each 7-segment display can represent numbers from 0 to 9, giving us a total of 1000 possible combinations.

Can binary multiplication be used to represent numbers beyond 359?

Yes, binary multiplication can be used to represent numbers beyond 359. We can simply add more 7-segment displays to represent larger numbers. For example, with 4 7-segment displays, we can represent numbers up to 4095.

What are the limitations of using binary multiplication for number representation?

One limitation of using binary multiplication for number representation is that it can only represent whole numbers. It also requires a significant amount of calculation and conversion from decimal to binary, which may not be practical for larger numbers. Additionally, it may not be as intuitive for individuals who are not familiar with binary operations.

Similar threads

Replies
4
Views
927
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
16
Views
2K
  • Programming and Computer Science
Replies
8
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
3K
  • Computing and Technology
Replies
4
Views
764
  • Engineering and Comp Sci Homework Help
Replies
14
Views
4K
Back
Top