Shift microoperations are fundamental operations used for serial transfer of data within digital computers. They are frequently employed in conjunction with arithmetic, logical, and other data-processing tasks. These operations manipulate the bits within a register by moving them to the left or right.
Efficient movement of data bits within registers
Used with arithmetic and logical operations
Precise control over individual bit positions
Transfers a 0 (zero) into the serial input of the register. Used for basic left or right shifting of binary data.
Key Feature: Always inserts zeros from the shifting end.
Circulates bits around the two ends of the register. Bits shifted out from one end are reinserted into the other end, ensuring no loss of information.
Key Feature: No data loss - bits wrap around.
Shifts signed binary numbers while preserving the sign. Left shifts multiply by 2, right shifts divide by 2.
Key Feature: Sign bit preservation for signed numbers.
Click the buttons below to see different shift operations in action!
The sign bit (leftmost bit) remains unchanged and is also transferred to the next position, preserving the sign of signed numbers.
┌─────┐ │ │ │ ┌───────┬───────┬───────────┬───────┬───────┐ └→│ Rn-1 │ Rn-2 │ → │ R1 │ R0 │ └───────┴───────┴───────────┴───────┴───────┘ ↑ │ └── Sign bit (feedback)
A 0 (zero) is inserted into the rightmost position. This operation effectively multiplies the number by 2, but overflow must be monitored.
An overflow occurs when the sign bit changes value after the shift. This can be detected using an Exclusive-OR operation on the two most significant bits before the shift: Vs = Rn-1 ⊕ Rn-2
Shift microoperations are commonly implemented using:
Built with multiplexers for high-speed operations