Understanding Shifting Registers: Operations for Multiplying and Dividing Binary Numbers
Shifting registers are specialized storage devices that contain binary numbers, allowing manipulation of these values through left and right shifting operations. By shifting to the left, a binary number can be multiplied by powers of 2, while shifting to the right divides the number by powers of 2. This article explores examples of shift-left and shift-right operations, illustrating how they are used to multiply and divide decimal numbers by converting them into binary form and performing shifts. Understanding these operations is crucial for digital systems.
Understanding Shifting Registers: Operations for Multiplying and Dividing Binary Numbers
E N D
Presentation Transcript
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