Barrel Shifter

For the Barrel Shifter assignment we will be design a barrel shifter that can shift left or right a selectable amount. We will display the register values we are shifting using a 4-digit 7-segment display. Below is a list of recommended steps to complete the assignment:

  1. Complete the barrel shifter design.
  2. Simulate the barrel shifter verifying that it is working properly.
  3. Integrate the barrel shifter with the binary to bcd design from lab 1 and the hex to 7 segment displays.

Setup

If your development board has a 4-digit on-board 7 segment display such as the BASYS 2 or BASYS 3 development board you can just use that. Otherwise you will need to connect a 4 digit 7 segment display. See the schematic setup below:


See the BOM below for components I used during the demonstration of this lab.

Verification

To verify that your design is working properly check that the amount you shift is indicated by the barrel shifter register. Fr example if you indicate that your shifting to the right by 1 bit, this is the same as dividing by 2. IF you shift to the right by 2 bits, this is the same as dividing by 4. The same goes for shifting left, except now you will be multiplying vs. dividing.