Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A shifter is a block that takes an n-bit word and changes the significance of ea

ID: 2083317 • Letter: A

Question

A shifter is a block that takes an n-bit word and changes the significance of each bit position of the word. (a) Draw the design of a block that optionally shifts an 8-bit 2's complement word by 2 bit positions to the left (toward the MSB)when a shift_left2 = 1'b1 and does not shift when shift_left 2 = '1 b0. How does this change the value of the word? Build this with 2:1 multiplexers. (b) If the design in (a) is instead optionally shifting to the right (toward the LSB) with a shift_right = 1'b1, what change would be needed to the design? How does this change the value of the word? You can choose to do either logical or arithmetic shift but you need to specify this clearly. (c) Draw the design of a variable shifter that can arbitrarily shift in either direction based on a 1-bit input, dir, for direction (dir = 1'b1 for left shift and dir = 1'b0 for right shift) and 3-bit binary input, shift[2:0], indicating the amount of shift (up to 7). Try to use the least number of 3:1 multiplexers. Each 3-input multiplexers accepts 3-inputs {top, mid, bot} and 3 select signals (1-hot) {selt, selm, selb} to select each of those inputs. (d) What is a barrel-shifter? How would you change the design in (c) to implement this.

Explanation / Answer

This component is given a five bit control bus which specifies how much to shift by and in what direction. The MSB of the CTL bus tells which direction, left if zero, right if one. The other four say how much to shift by. The other input is a sixteen bit bus with the actual data to be shifted. The output is a sixteen bit bus with the result.

To test this component TestBench is to be used. Sixteen ones are fed into the INDATA bus. The CTL is then incremented from zero to fifteen. The ones shift left and slowly disappear. When the CTL reaches sixteen the MSB of OUTDAT is the only bit that is low if the shifter is implemented correctly. The ones should now shift right and eventually disappear leaving all zeros. When CTL reaches thirty-one all values in the OUTDAT should be zero.

If this is true everything has been implemented correctly and the barrel shifter is good.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote