70 likes | 188 Views
Shifting Registers. What is a Shifting Register?. They are the same as registers since they store binary numbers.
E N D
What is a Shifting Register? • They are the same as registers since they store binary numbers. • Called shifting registers since they shift (left or right) the binary number stored in them in order to multiply or divide, by powers of 2 (2, 4, 8, 16, etc.) the binary number 2 Operations: Shift-Left Operation and Shift-Right Operation
Shift-Left Operation • Assume we want to multiply the decimal number 610 by 2 • calculate the binary number equivalent to 610 which is: • shift the binary number to the left and add 0 to the least significant bit (LSB). 1102
Shift-Left Example Multiply the decimal number 410 by 4 Calculate the binary number equivalent to 410 which is: 1002 Move one shift to the left to multiply by 2 Move another one shift to the left to multiply again by 2 1002 = 410 1 0 0 10002 = 810 1 0 0 0 100002 = 1610 1 0 0 0 0
Shift-Right Operation • Assume we want to divide the decimal number 2010by 2 • calculate the binary number equivalent to 2010 which is: • shift the binary number to the right 101002
Shift-Right Example Divide the decimal number 2410 by 4 Calculate the binary number equivalent to 2410 which is: 110002 Move one shift to the right to divide by 2 Move another one shift to the right to divide again by 2 110002 = 2410 1 1 0 0 0 11002 = 1210 1 1 0 0 1102 = 610 1 1 0