﻿1
00:00:04,210 --> 00:00:11,380
‫Welcome to the barrel shifter demonstration with the ardy the seven board I have the bear shifter lab

2
00:00:11,440 --> 00:00:21,460
‫running on my Arties the 7 board where I have all the four digit seven segment display as well as three

3
00:00:21,520 --> 00:00:25,690
‫electronic slide switches with the 7 segment display.

4
00:00:25,840 --> 00:00:33,820
‫I have each one of the segments running back there are a 56 ohm resistor that I have tied in to my to

5
00:00:33,820 --> 00:00:37,710
‫the J port of the Arties the 7 board.

6
00:00:37,810 --> 00:00:42,320
‫Then I also have the four digit selects on the on the seventh.

7
00:00:42,320 --> 00:00:51,820
‫I mean display running through a to an of 4 transistor with a 470 ohm resistor connected to the base

8
00:00:51,970 --> 00:01:01,180
‫of the transistor fed back into the J.B. port of the Arty's the seven and then I have the three slide

9
00:01:01,180 --> 00:01:08,420
‫switches also fed into the J.B. port of the Arty's seven development board with the barrow shifter.

10
00:01:08,420 --> 00:01:15,110
‫The three slide switches are used to indicate the amount that I want to shift to the left or to the

11
00:01:15,110 --> 00:01:15,910
‫right.

12
00:01:16,160 --> 00:01:23,990
‫And then I have the switch 0 and switch one are used to indicate which way what the operation was going

13
00:01:23,990 --> 00:01:24,830
‫to perform.

14
00:01:24,950 --> 00:01:28,260
‫If I have them both 0 that's a hold.

15
00:01:28,400 --> 00:01:31,930
‫If I have a zero in a one that will give me a shift right.

16
00:01:31,940 --> 00:01:35,990
‫Operation 5 a 1 or 0 then is there.

17
00:01:35,990 --> 00:01:43,460
‫That gives me a shift left operation and if I have them both high at one one that gives me a load operation

18
00:01:44,030 --> 00:01:50,660
‫and then my button zero is what is going to operate as the clock for the barrel shifter just so we can

19
00:01:50,660 --> 00:01:53,750
‫see every time I push the button what's actually happening.

20
00:01:53,750 --> 00:01:58,880
‫So right now I have switched 0 and switch one both in one one position.

21
00:01:58,940 --> 00:02:04,100
‫So this is going to load which we have a preconfigured value of 128.

22
00:02:04,100 --> 00:02:09,200
‫We're going to load into our shift register which will be displayed on the set of saving display.

23
00:02:09,210 --> 00:02:16,270
‫So when I pressed button 0 we'll see a value of 128 loaded onto the segment display.

24
00:02:16,310 --> 00:02:25,490
‫Now with the barrel shifter what we can do is perform a shift right operation by having switch one down

25
00:02:25,490 --> 00:02:29,300
‫to zero and leaving switch 0 up to 1.

26
00:02:29,300 --> 00:02:35,110
‫So with this operation we're going to shift right to the amount that's indicated on the slide switches

27
00:02:35,270 --> 00:02:38,780
‫on the breadboard with the light switches on the breadboard.

28
00:02:38,780 --> 00:02:45,240
‫If they're shifted to the right that means there are one or high high if they're shifted to the left.

29
00:02:45,260 --> 00:02:47,330
‫That means there is zero or pulled low.

30
00:02:47,540 --> 00:02:49,620
‫So right now we have our shift out.

31
00:02:49,640 --> 00:02:57,610
‫We've got 001 which means we're going to shift right one bit which every bit you shift is a divider

32
00:02:57,620 --> 00:02:59,240
‫multiply by two.

33
00:02:59,270 --> 00:03:02,800
‫Since we're shifting to the right it's a divide by two.

34
00:03:02,810 --> 00:03:05,830
‫So if we take 128 we divide it by two.

35
00:03:05,900 --> 00:03:06,930
‫We'll see a value.

36
00:03:06,980 --> 00:03:10,890
‫We should see a value of 64 on the 7st display.

37
00:03:11,180 --> 00:03:17,030
‫And when I press this button 0 it's going to simulate a clock pulse on my barrel shifter.

38
00:03:17,060 --> 00:03:24,650
‫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

39
00:03:24,650 --> 00:03:25,450
‫shifter.

40
00:03:25,670 --> 00:03:31,220
‫And if I press it again we'll divide by two once more which will take us down to thirty two and I can

41
00:03:31,220 --> 00:03:33,600
‫press this once again to get down to 16.

42
00:03:33,680 --> 00:03:39,270
‫And again we're down to eight and also down to four as well as two.

43
00:03:39,270 --> 00:03:46,710
‫Now if I want to go ahead and test the other way shift a shift left operation which performs the multiplication

44
00:03:46,710 --> 00:03:47,590
‫by 2.

45
00:03:47,640 --> 00:03:55,080
‫So if I take and switch my slide switches so that now I have a 1 0 which indicates a shift left and

46
00:03:55,140 --> 00:04:03,540
‫I'll keep my shift amount to 0 0 1 so I'll still be shifting by one bit which is simulating a multiply

47
00:04:03,540 --> 00:04:04,520
‫by two.

48
00:04:04,530 --> 00:04:16,050
‫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

49
00:04:16,050 --> 00:04:23,550
‫amount but that the key to know here is that if I'm able to perform this multiplication or division

50
00:04:23,960 --> 00:04:29,100
‫indivisibility of two and just one clock pulse which is the key of a barrel shifter you can perform

51
00:04:29,100 --> 00:04:33,120
‫this multiplication using other algorithms but it takes multiple calk pulses.

52
00:04:33,120 --> 00:04:38,760
‫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

53
00:04:39,180 --> 00:04:42,480
‫a barrel shifter to make it happen in one clock cycle.

54
00:04:42,630 --> 00:04:47,880
‫And so that is the implementation demonstration of the barrel shift are running on already of the seven.

