Section : PC- F ID : 201-15-3166 Department of CSE, DIU Submitted To
Name : Rubel Sheikh
Lecturer Department of CSE, DIU
Shift and Rotate Instruction 2
Table of Contents ● Introduction to Shift And Rotate operations ● Types of Shift And Rotate operations ● Introduction about SHR, SAR, SHL, SAL ● Applications of both operations
Shift and Rotate Instruction 3
What is Shift and Rotate intructuion? “ Shift Allow to be shifted one bit place to the left or to the right.
”5 Shift and Rotate Instruction 5
“ Rotate
Used to rotating the bits of accumulator.
”6 Shift and Rotate Instruction 6
Types of Shift Operations ● SHR ● SAR ● SHL ● SAL
Shift and Rotate Instruction 7
Types of Rotate Operations ● ROL ● ROR ● RCL ● RCR
Shift and Rotate Instruction 8
Shift Arithmetic Shift Right Right Mentioned bits in the Mentioned bits in the register to the right side register to the right side one by one by inserting one by one, but instead the same number of of inserting the zeroes zeroes from the left end. from the left end, the MSB is restored.
Shift and Rotate Instruction 9
Shift Arithmetic Shift Left Left Mentioned bits in the Mentioned bits in the register to the left side register to the left side one by one by inserting one by one, but instead the same number of of inserting the zeroes zeroes from the right from the left end, the end. LSB is restored.
Shift and Rotate Instruction 10
Use of Shift Instruction - ● Used for shifting bits one by one left or right side.
Shift and Rotate Instruction 11
Use of Rotate Instruction - ● Used in arithmetic multiply and divide operations and for serial data transfer.