CS101 Topic 39

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 6

Data Manipulation

Rotation and Shift

Dr. M. Tanvir Afzal


Rotation and Shift

ALU

 Moving bits within the register


(right or left)
 Example:

2 Dr. M. Tanvir Afzal


Rotation and Shift
Circular Shift/Rotation
 Consider a byte 10010101
 One bit right, and rightmost should be put
at the hole created on the left side.

3 Dr. M. Tanvir Afzal


Rotation and Shift

Logical Shift
 Consider a byte 10010101
 One bit right, and rightmost should be
discarded and on left side we put Zero.

4 Dr. M. Tanvir Afzal


Rotation and Shift
Logical Shift
 On left side for 2’s complement notation
multiplying the value
 As decimal values are multiplied by 10
when shifted.
 We should take care of sign bit – such shifts
sometimes are called Arithmetic Shifts.

5 Dr. M. Tanvir Afzal


Summary

Rotation and Shifting


 Left/right rotation and shifting
 Multiplication and division
 Arithmetic Shifts.

6 Dr. M. Tanvir Afzal

You might also like