(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

A, and B both are 16 bits wide; A is entity to shift and B is by how much;

we are supposed to implement a BARREL shifter. And here's the explanation (which does not make much sense to me, esp. the example) given in lab document:

A barrel shifter is a combinational logic device that incrementally shifts in stages. In our barrel shifter, we will have 4 stages. Each stage can choose to shift or not to shift, giving any total shift amount. For example, to shift an input by 9, stages one and four will shift 1 time and 8 times, respectively. Stages two and three will not shift. Notice that the binary number 9 is "1001". How convenient that the fourth bit and the first bit are 1 and the second and the third bits are 0.

3. The attempt at a solution

ok, I know how to write the shift register, a regular without the "barrel", and after some googling, I found that barrel basically shifts by the amounts of bits specified at once. If someone could explain how the description from the lab document makes sense that is all i need to understand.... thanks in advance.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Barrel shifter 16-bits (vhdl)

**Physics Forums | Science Articles, Homework Help, Discussion**