Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1

2 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 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 2 Operations: Shift-Left Operation and Shift-Right Operation

3 Shift-Left Operation Assume we want to multiply the decimal number 6 10 by 2 calculate the binary number equivalent to 6 10 which is: shift the binary number to the left and add 0 to the least significant bit (LSB). 110 2

4 Shift-Left Example Multiply the decimal number 4 10 by 4 1.Calculate the binary number equivalent to 4 10 which is: 100 2 2.Move one shift to the left to multiply by 2 3.Move another one shift to the left to multiply again by 2 100 100 2 = 4 10 1000 1000 2 = 8 10 10000 2 = 16 10 10000

5 Shift-Right Operation Assume we want to divide the decimal number 20 10 by 2 calculate the binary number equivalent to 20 10 which is: shift the binary number to the right 10100 2

6 Shift-Right Example Divide the decimal number 24 10 by 4 1.Calculate the binary number equivalent to 24 10 which is: 11000 2 2.Move one shift to the right to divide by 2 3.Move another one shift to the right to divide again by 2 11000 11000 2 = 24 10 1100 1100 2 = 12 10 110 110 2 = 6 10


Download ppt "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."

Similar presentations


Ads by Google