Shift and Rotate Operations Barrel Shifters
Shift and Rotate Operations Barrel Shifters
Shift and Rotate Operations Barrel Shifters
Part I
2 Barrel Shifters
Logarithmic Barrel Shifters
Combining Rotate and Shift Operations
Bidirectional Shift and Rotate Operations
Arithemtic Circuits
Shift and Rotate Operations
B A
n bits n bits
n bits
Select n contiguous bits
Barrel Shifters
X7 X6 X5 X4 X3 X2 X1 X0
X3 X2 X1 X0 X7 X6 X5 X4
0 X7 X6 X5 X4 X3 X2 X1 X0
X7 X6 X5 X4
n2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
If we need a shift instead of a
rotate, we feed a 0 instead of
the corresponding bit.
n1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
ASR
X3 X2 X1 X0
X7
0 1
X7 X6 X5 X4 X3 X2 X1 X0
X0 X1 X2 X3 X4 X5 X6 X7 We can use the same
Left 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 hardware for left and right
shift/rotate operations.
This can be done by adding
Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 rows of muxes at the input and
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 output which reverse the order
of bits.
Arithemtic Circuits
Barrel Shifters
Bidirectional Shift and Rotate Operations