﻿1
00:00:04,730 --> 00:00:11,570
‫Welcome to the barrow shift or demonstration with the already board I have the seven segments boy and

2
00:00:11,570 --> 00:00:14,150
‫two slides which is set up on the breadboard.

3
00:00:14,510 --> 00:00:23,840
‫The 7st display I have all the different segments type through the 56 ohm resistor back into the J port

4
00:00:24,380 --> 00:00:34,070
‫p mod of the arty board and the four digit selects are coming into the GBP mod of the aready board and

5
00:00:34,070 --> 00:00:35,900
‫then the two slides switches.

6
00:00:35,930 --> 00:00:41,390
‫I have coming fed into the JCP model port.

7
00:00:41,420 --> 00:00:48,470
‫Now once I load the the barrel shifter design onto the already board the 7st and display will show all

8
00:00:48,500 --> 00:00:50,490
‫four zeroes.

9
00:00:50,580 --> 00:00:57,870
‫And so what we want to do is by modifying the two flights which is on the breadboard which is R which

10
00:00:57,870 --> 00:01:04,070
‫control what the barrel shifter does if there 0 0 we're going to hold it to 0 1.

11
00:01:04,140 --> 00:01:05,470
‫Want to shift right.

12
00:01:05,520 --> 00:01:13,020
‫If it's a 1 0 we want to shift left and if they're both ones we want to load a value in the value we're

13
00:01:13,020 --> 00:01:19,390
‫going to load in is a preconfigured value that's set inside of the barrel shifter design.

14
00:01:19,410 --> 00:01:26,150
‫So if we set both of the side switches to one which we just slide them both forward to the right and

15
00:01:26,360 --> 00:01:28,780
‫push the button zero.

16
00:01:28,850 --> 00:01:34,000
‫This will load the preconfigured value of 128 into our shift register.

17
00:01:34,070 --> 00:01:40,160
‫So we push that we'll now see 128 shown on the 7 segment display.

18
00:01:40,730 --> 00:01:43,860
‫So we want to do is do a divide operation.

19
00:01:44,030 --> 00:01:49,670
‫So if we do a divide by two we'll see a value of 64 in order to do that.

20
00:01:49,670 --> 00:01:54,380
‫We to set we shift by one bit to the left.

21
00:01:54,380 --> 00:01:57,100
‫So in order to do a arcsin and one bit to the right.

22
00:01:57,110 --> 00:02:07,010
‫So in order to do a right shift we want to have a value of 0 and then 1 on our slide switch and on our

23
00:02:07,010 --> 00:02:13,400
‫shift switches which we have on the board we want to have a value of.

24
00:02:13,610 --> 00:02:18,450
‫We wanted to put the least in the begin bit or the s w zero up to 1.

25
00:02:18,770 --> 00:02:26,490
‫So this is going to shift the bits in our register the 128 one bit to the right which will effectively

26
00:02:26,490 --> 00:02:28,750
‫be a divide by two.

27
00:02:28,760 --> 00:02:34,560
‫So when I press this button 0 we should see a value of 64 on a 7 segment display.

28
00:02:34,580 --> 00:02:36,260
‫Now I pressed it twice.

29
00:02:36,290 --> 00:02:39,300
‫So you'll see what 64 and divide by 2 again.

30
00:02:39,410 --> 00:02:40,700
‫Give us 32.

31
00:02:40,790 --> 00:02:44,320
‫If I press it once more that will divide by two.

32
00:02:44,390 --> 00:02:46,860
‫Once again and take it down to 16.

33
00:02:46,880 --> 00:02:49,390
‫Now conversely we can go the opposite way.

34
00:02:49,520 --> 00:02:54,360
‫If we do a shift left we will be actually multiplying.

35
00:02:54,620 --> 00:02:57,870
‫So in order to do a shift left we want to have a 1 0.

36
00:02:57,890 --> 00:03:03,320
‫So I got to switch my switches make it a 1 and then a zero.

37
00:03:03,350 --> 00:03:08,080
‫So now I'm going to be multiplying by two because I'm doing a shift left.

38
00:03:08,140 --> 00:03:12,870
‫So when I press the button I should take that 16 value and multiply it by two.

39
00:03:13,130 --> 00:03:18,060
‫So I press the button you'll see me multiply that by two and get a value of 32.

40
00:03:18,080 --> 00:03:24,310
‫I press the button once again or you get a value of 64 and now I keep pressing for press again I'll

41
00:03:24,320 --> 00:03:25,450
‫get a value 128.

42
00:03:25,450 --> 00:03:27,380
‫I just keep multiplying by 2.

43
00:03:27,380 --> 00:03:31,260
‫Now what I can do at any point in time is go ahead and reload the value.

44
00:03:31,430 --> 00:03:38,970
‫So if I make both of my slide switches at one that's the load configuration if I press my button zero

45
00:03:40,110 --> 00:03:44,080
‫that gets my register back to the 128 value.

46
00:03:44,200 --> 00:03:50,080
‫And so I can keep by selecting different division shift left or shift right.

47
00:03:50,100 --> 00:03:53,850
‫We can perform very fast multiplication and division.

48
00:03:54,000 --> 00:03:56,150
‫As always it's Empower them too.

49
00:03:56,460 --> 00:04:04,170
‫So by changing our values to determine whether we're shifting left right and by changing the amount

50
00:04:04,170 --> 00:04:12,330
‫we shift with a slide switches on the Ardie board down here we can determine how many what are multiplication

51
00:04:12,360 --> 00:04:15,570
‫or division is by if it's 2 4 8 16.

52
00:04:15,720 --> 00:04:16,700
‫So on and so forth.

53
00:04:16,740 --> 00:04:22,320
‫And so the big thing with the bear shifter is it becomes a very efficient way to perform multiplication

54
00:04:22,380 --> 00:04:23,170
‫and division.

55
00:04:23,280 --> 00:04:26,710
‫Whenever you're doing something in a multiple of two.

56
00:04:27,090 --> 00:04:31,340
‫And that is how the barrel shifter should be running on your already board.

