Download presentation
Presentation is loading. Please wait.
Published byOscar Wheeler Modified over 9 years ago
1
BINARY SHIFT Multiplication and Division
2
Binary Shift As you know a computer can only add, not subtract. For the same token it can still only add, not multiply or divide. Multiplication is usually achieved by repeatedly adding, and division is usually achieved by repeatedly 'subtracting' (or as we know, adding through the use of two's complement).
3
Binary Shift There are occasions when you can 'cheat' in multiplication/division, but only when the number you are multiplying/dividing by is a number on the binary scale eg. 2, 4, 8 etc. We'll stick with whole numbers
4
Binary Shift Firstly, you need to remember the binary scale Now you need to pay close attention to two things: the number in each column The exponent above the 2, that corresponds to each number Eg. The number 8 has the exponent 3 2525 2424 23232 2121 2020 32168421
5
Binary Shift: Left Shift Now lets use a multiplication example: 5 x 8 We can start by determining the exponent that corresponds to 8, and re-write the question 5 x 2 3
6
Binary Shift: Left Shift Remember the problem is: 5 x 2 3 Now use your columns to write down 5 in binary Below you original value of 5, move all the bits 3 places to the left, and pad the holes with 0’s 2525 2424 23232 2121 2020 32168421 101 101000
7
Binary Shift: Left Shift 5 x 2 3 (or if you prefer 5 x 8) is equal to 40, this can be easily achieved by shifting the whole number 3 places up the binary scale. Try the following two multiplications: 7 x 4 3 x 16
8
Binary Shift: Right Shift Now lets look at a division example: 35 / 16 We can start by determining the exponent that corresponds to 16, and re-write the question 35 / 2 4
9
Binary Shift: Right Shift Remember the problem is: 35 / 2 4 Now use your columns to write down 35 in binary Below you original value of 35, move all the bits 4 places to the right 2525 2424 23232 2121 2020. 2 -1 2 -2 2 -3 2 -4 32168421..5.25.125.0625 100011.. 10.0011
10
Binary Shift: Right Shift 35 x 2 4 (or if you prefer 35 / 16) is equal to 2.1875, this can be easily achieved by shifting the whole number 4 places down the binary scale. Try the following two divisions: 17 / 4 131 / 32
11
Binary Shift At this point you should know that: Multiplying is a Left Shift (because you are making the number bigger) Dividing is a Right Shift (because you are making the number smaller) If one of the numbers in the multiplication/division is a number on the binary scale, check the exponent of that number and move the other number up/down the scale by the number of places in the exponent
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.