Author |
Topic: MULTIPLY WITHOUT MULTIPLYING (Read 3100 times) |
|
eviljed
Newbie
Posts: 16
|
|
MULTIPLY WITHOUT MULTIPLYING
« on: Aug 9th, 2002, 10:50am » |
Quote Modify
|
Multiply by 8 without using multiplication or addition. Now do the same with 7. For 8: Convert to binary. Shift left twice. That'll do it. (note that the shifts put zeros in the least significat values). For 7: I'll have to get back to you on that.
|
|
IP Logged |
|
|
|
eviljed
Newbie
Posts: 16
|
|
Re: MULTIPLY WITHOUT MULTIPLYING
« Reply #1 on: Aug 9th, 2002, 11:02am » |
Quote Modify
|
I just had an ID-10T error. (aka, i'm an idiot). You shift to the left three times. Two shifts only multiplies it by 4.
|
|
IP Logged |
|
|
|
Aaron
Newbie
Gender:
Posts: 14
|
|
Re: MULTIPLY WITHOUT MULTIPLYING
« Reply #2 on: Aug 9th, 2002, 11:54am » |
Quote Modify
|
I am assuming that addition and subtraction are different functions here... n = (n << 3) - n; I am still fiddling with the bits for a solution that involves no arithmatics, short of going all the way to implementing a binary subtraction function with logigates.
|
|
IP Logged |
|
|
|
-D-
Guest
|
|
Re: MULTIPLY WITHOUT MULTIPLYING
« Reply #3 on: Aug 9th, 2002, 4:27pm » |
Quote Modify
Remove
|
There is a long thread on this already furthur down the page with several ideas on it. -D-
|
|
IP Logged |
|
|
|
|