I learned that if you want to multiplicate any binary number with any binary number you do following:
- you seperate the number which is the multiplicator in a binary number which holds only one 1. Example:
00000101 = 00000100, 00000001.
Then you do the leftshift which those new numbers
Then you simple add the results.
So what about division with any number?
I heard you do right shift, but that counts only for division by 2. But I want any number to divide. I am not talking about floating numbers. But how could I divide 25 / 5 in binary?
Please tell me an example, Thanks a lot!
I tried to do after the rightshift a subtraction (so in a way like the multiplication), but it won't work :(
Example for multiplication for any numbers:
00001111 * 00000101 means:
00001111 * 00000100 + 00001111 * 00000001 = 00111100 + 00001111 = 01001011 (result)