‫Welcome to the barrel shifter demonstration with the ardy the seven board I have the bear shifter lab
‫running on my Arties the 7 board where I have all the four digit seven segment display as well as three
‫electronic slide switches with the 7 segment display.
‫I have each one of the segments running back there are a 56 ohm resistor that I have tied in to my to
‫the J port of the Arties the 7 board.
‫Then I also have the four digit selects on the on the seventh.
‫I mean display running through a to an of 4 transistor with a 470 ohm resistor connected to the base
‫of the transistor fed back into the J.B. port of the Arty's the seven and then I have the three slide
‫switches also fed into the J.B. port of the Arty's seven development board with the barrow shifter.
‫The three slide switches are used to indicate the amount that I want to shift to the left or to the
‫right.
‫And then I have the switch 0 and switch one are used to indicate which way what the operation was going
‫to perform.
‫If I have them both 0 that's a hold.
‫If I have a zero in a one that will give me a shift right.
‫Operation 5 a 1 or 0 then is there.
‫That gives me a shift left operation and if I have them both high at one one that gives me a load operation
‫and then my button zero is what is going to operate as the clock for the barrel shifter just so we can
‫see every time I push the button what's actually happening.
‫So right now I have switched 0 and switch one both in one one position.
‫So this is going to load which we have a preconfigured value of 128.
‫We're going to load into our shift register which will be displayed on the set of saving display.
‫So when I pressed button 0 we'll see a value of 128 loaded onto the segment display.
‫Now with the barrel shifter what we can do is perform a shift right operation by having switch one down
‫to zero and leaving switch 0 up to 1.
‫So with this operation we're going to shift right to the amount that's indicated on the slide switches
‫on the breadboard with the light switches on the breadboard.
‫If they're shifted to the right that means there are one or high high if they're shifted to the left.
‫That means there is zero or pulled low.
‫So right now we have our shift out.
‫We've got 001 which means we're going to shift right one bit which every bit you shift is a divider
‫multiply by two.
‫Since we're shifting to the right it's a divide by two.
‫So if we take 128 we divide it by two.
‫We'll see a value.
‫We should see a value of 64 on the 7st display.
‫And when I press this button 0 it's going to simulate a clock pulse on my barrel shifter.
‫So when I press the button zero you'll see we now have a value of 64 in on our shift register or a barrel
‫shifter.
‫And if I press it again we'll divide by two once more which will take us down to thirty two and I can
‫press this once again to get down to 16.
‫And again we're down to eight and also down to four as well as two.
‫Now if I want to go ahead and test the other way shift a shift left operation which performs the multiplication
‫by 2.
‫So if I take and switch my slide switches so that now I have a 1 0 which indicates a shift left and
‫I'll keep my shift amount to 0 0 1 so I'll still be shifting by one bit which is simulating a multiply
‫by two.
‫So if I press up to four to eight 16 32 64 and then back up to 128 and I can shift down by any various
‫amount but that the key to know here is that if I'm able to perform this multiplication or division
‫indivisibility of two and just one clock pulse which is the key of a barrel shifter you can perform
‫this multiplication using other algorithms but it takes multiple calk pulses.
‫So if I want to go from 128 and if I buy two or take any value in there and divide it by two I can do
‫a barrel shifter to make it happen in one clock cycle.
‫And so that is the implementation demonstration of the barrel shift are running on already of the seven.