Question

A barrel shifter is a digital subsystem that can shift multiple bits in a vectors positions...

A barrel shifter is a digital subsystem that can shift multiple bits in a vectors positions at once. In a single pass through the shifter, the input can rotate from 0 to 7 positions. Barrel shifters are useful for implementing bit extraction operations supported in many computer instruction sets. The subsystem has eight data inputs, D7, D6, , D0, eight data outputs, O7, O6, …,O0, and three control inputs, S2, S1, S0. The control inputs specify the number of positions to shift the input to the left. Inputs that "fall off the end" are rotated around to the low-order bits of the output. For example, when S2 = S1 = S0 = 0, the inputs are simply gated straight through to the outputs: O7 = D7, O6 = D6, , O1 = D1, O0 = D0. When S2 = S1 = 0, S0 = 1, the input bits are shifted one place toward the left: O7 = D6, O6 = D5, …, O1 = D0, O0 = D7. Note that D7 is rotated around to the 0th output position. When S2 = S1 = S0 = 1, the input is shifted seven positions to the left, with the high-order bits wrapping around to the low-order output positions: O7 = D0, O6 = D7, …, O1 = D2, O0 = D1. This is the same as shifting one position to the right, with the inputs wrapping from the low-order to the high-order positions.

Write the truth table for the 8-bit barrel shifter with the bit positions determined by the value of the three control signals.

Homework Answers

Answer #1

Data inputs: D7, D6, D5, D4, D3, D2, D1, D0

Data outputs: O7, O6, O5, O4, O3, O2, O1, O0

Control signals: S2, S1, S0

Truth table for 8-bit barrel shifter is given below,

S2 S1 S0     O7 O6 O5 O4 O3 O2 O1 O0
0 0 0 D7 D6 D5 D4 D3 D2 D1 D0
0 0 1 D6 D5 D4 D3 D2 D1 D0 D7
0 1 0 D5 D4 D3 D2 D1 D0 D7 D6
0 1 1 D4 D3 D2 D1 D0 D7 D6 D5
1 0 0 D3 D2 D1 D0 D7 D6 D5 D4
1 0 1 D2 D1 D0 D7 D6 D5 D4 D3
1 1 0 D1 D0 D7 D6 D5 D4 D3 D2
1 1 1 D0 D1 D2 D3 D4 D5 D6 D7

The control inputs S2, S1, S0 specify the number of positions to shift to the left and the bits that fall off the end (MSB) are rotated to the lower order bits (LSB). Hence, after 8 iterations, the output is shifted 7 positions to the left. This is the same as shifting the bits by one position to the right.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions