• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

binary multiplication?

Alex

Diamond Member
ok i kinda get addition and subtraction but multiplication kills me

whats the rule?

for example our prof gave us this (just found out its from google, lol)

Rules of Binary Multiplication
0 x 0 = 0
0 x 1 = 0
1 x 0 = 0
1 x 1 = 1, and no carry or borrow bits
For example,

00101001 × 00000110 = 11110110

0 0 1 0 1 0 0 1 = 41(base 10)
× 0 0 0 0 0 1 1 0 = 6(base 10)
--------------------------------------------------------------------------------
0 0 0 0 0 0 0 0
0 0 1 0 1 0 0 1
0 0 1 0 1 0 0 1
--------------------------------------------------------------------------------

0 0 1 1 1 1 0 1 1 0 = 246(base 10)

i dont get any of the lines of work between the dotted lines 🙁

can anyone help plz?
 
From one line to the next, you have to shift one binary place to the left. It's just like base10 multiplication. Take the rightmost place on the 2nd operand. If the value is 0, then your row is straight 0s. If it is a 1, then the row is identical to the first operand. Then do it again with the next binary digit, but shift it one bit to the left. I don't know any other wayto really explain it....
 
Originally posted by: Elemental007
what kind of major are you where that is a midterm content?

im second-year comp sci major...

they have us learn binary arithmetic etc for an assembler course 🙁
 
Originally posted by: franguinho
well as it turns out it wasnt in my midterm! phew! 🙂
Then it will be on the final so you'd better learn it 🙂

And yes, it is just shift-and-add the original for each digit in what you're multiplying it by. You can try it yourself with normal decimal multiplication just by making the multiplier a number like "101":

55
x 101
-------
= 55 + 0 * 10 (shifted once) + 55*100 (that is, 55 shifted twice)

Binary operations might seem useless to you now but they're used heavily in hardware, in compact file formats like SWF (Shockwave Flash), in efficient data structures, and in option flags for API calls. Usually it's just shifts and masks rather than multiplication and division though.
 
Originally posted by: DaveSimmons
Originally posted by: franguinho
well as it turns out it wasnt in my midterm! phew! 🙂
Then it will be on the final so you'd better learn it 🙂

And yes, it is just shift-and-add the original for each digit in what you're multiplying it by. You can try it yourself with normal decimal multiplication just by making the multiplier a number like "101":

55
x 101
-------
= 55 + 0 * 10 (shifted once) + 55*100 (that is, 55 shifted twice)

Binary operations might seem useless to you now but they're used heavily in hardware, in compact file formats like SWF (Shockwave Flash), in efficient data structures, and in option flags for API calls. Usually it's just shifts and masks rather than multiplication and division though.


whoa hmm this shifting this is more complicated than i though but i kinda get it now...
 
Back
Top