A shifter is a block that takes an n-bit word and changes the significance of ea
ID: 2083299 • 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_left 2 = 1'b1 and does not shift when shift_left2 = 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? (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 input indicating the amount of shift (up to 7). Try to use the least number of 3:1 multiplexers. (d) What is a barrel-shifter? How would you change the design in (c) to implement this.Explanation / Answer
A barrel shifter is a digital circuit that can shift a data word by a specified number of bits without the use of any sequential logic, only pure combinatorial logic. One way to implement it is as a sequence of multiplexers where the output of one multiplexer is connected to the input of the next multiplexer in a way that depends on the shift distance. A barrel shifter is often used to shift and rotate n-bits in modern microprocessors, typically within a single clock cycle.
For example, take a four-bit barrel shifter, with inputs A, B, C and D. The shifter can cycle the order of the bits ABCD as DABC, CDAB, or BCDA; in this case, no bits are lost. That is, it can shift all of the outputs up to three positions to the right (and thus make any cyclic combination of A, B, C and D). The barrel shifter has a variety of applications, including being a useful component in microprocessors (alongside the ALU).
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.