Description:
Logical Shifter:
- fills the empty space with 0
- Shift left: A >> 2
- Shift right: A << 2
Arithmetic Shifter:
- Fill the empty space with the most MSB
- Shift right: 11001 >> 2 = 11110
- shift right logical: fill in the left most with sign bit/MSB of the old value
- In two’s complement, if it negative, it keeps the same value by adding 1; otherwise, add 0 in front dont change
- shift left: 11001 << 2 = 00100
Rotator Shifter:
- Rotate like a queue
- The selector decides how many bits are shifted and which bit to replace it
- Can be used as multiplier and divider