﻿1
00:00:06,620 --> 00:00:13,850
‫Welcome to the BCT display explained lecture in this lecture I'm going to introduce and explain how

2
00:00:13,850 --> 00:00:17,630
‫binary coded decimal display works.

3
00:00:17,630 --> 00:00:24,350
‫What is binary code of decimal binary code decimal or also known as BCT.

4
00:00:24,430 --> 00:00:33,370
‫This represents a spread of bits to a single digit A for obesity value ranges from 0 to 9.

5
00:00:33,590 --> 00:00:39,530
‫A traditional binary value will range from zero to the highest number possible with the given number

6
00:00:39,530 --> 00:00:41,160
‫of bits.

7
00:00:41,450 --> 00:00:49,340
‫The advantage of using BCT is that it's much easier for humans to understand now the downfall of using

8
00:00:49,340 --> 00:00:54,610
‫a binary code of decimal is that it's not the most efficient use of bits in a register.

9
00:00:56,700 --> 00:01:00,170
‫So let's take a look at a standard binary counterexample.

10
00:01:00,240 --> 00:01:02,070
‫We have a binary counter.

11
00:01:02,070 --> 00:01:04,650
‫That's four bits wide.

12
00:01:04,770 --> 00:01:09,080
‫We want to count from 0 to 15.

13
00:01:09,270 --> 00:01:15,360
‫So we are binary value starts out at zero which gives us the for 4 bits.

14
00:01:15,360 --> 00:01:23,340
‫We have four zeroes in our largest value which are be four ones gives us a hexadecimal value of f and

15
00:01:23,360 --> 00:01:25,500
‫a decimal value of 15.

16
00:01:25,830 --> 00:01:30,810
‫And so if we count true we're using every single combination of those four bits.

17
00:01:30,990 --> 00:01:39,150
‫And there's a total of 16 combinations and we go through all of them counting from 0 to 15 in decimal.

18
00:01:39,150 --> 00:01:45,740
‫However when our counter is displayed we can display the hexadecimal value which gives us here 1 2 3.

19
00:01:45,750 --> 00:01:51,700
‫All the way down to F which is which is nice because it's very efficient and we're using every single

20
00:01:51,700 --> 00:01:53,210
‫bit combination possible.

21
00:01:53,220 --> 00:01:59,620
‫However it's not the easiest to read or understand if you're seeing multiple digits or you're not an

22
00:01:59,620 --> 00:02:01,290
‫engineer you know.

23
00:02:01,290 --> 00:02:05,920
‫So I wouldn't understand how the hexadecimal conversion converts to a decimal value.

24
00:02:06,220 --> 00:02:12,510
‫So if we take a counter and let's try and do that in binary code a decimal what would that look like.

25
00:02:12,850 --> 00:02:20,590
‫Well the forbit example would show us we have we start from 0 0 0 0 0 which is the hexadecimal value

26
00:02:20,680 --> 00:02:29,860
‫of zero and a decimal value of 0 and go to the binary value 0 1 0 0 0 1 which is the hexadecimal value

27
00:02:29,860 --> 00:02:32,640
‫of 9 and a decimal value of 9.

28
00:02:32,950 --> 00:02:39,610
‫And if you notice after 1 0 0 1 we have all axes and that just indicates that it's a don't care.

29
00:02:39,610 --> 00:02:43,860
‫After that our binary code decimal we're not going to display anything.

30
00:02:43,960 --> 00:02:51,820
‫So we're only displaying hexadecimal and decimal or binary values of 0 2 9 and the disadvantage of this

31
00:02:51,820 --> 00:02:55,770
‫is we're not using every single combination of the bits available.

32
00:02:55,780 --> 00:03:00,820
‫So we're not being 100 percent efficient with our memory space

33
00:03:04,060 --> 00:03:07,320
‫for binary counters are much easier to implement.

34
00:03:07,330 --> 00:03:13,420
‫However a binary code a decimal counter is much easier to interpret from a human standpoint.

35
00:03:13,450 --> 00:03:23,740
‫So for example if we have a binary value of 1 0 1 0 0 0 1 0 as far as for humans to read that that becomes

36
00:03:23,830 --> 00:03:28,690
‫relatively complex or hard to intuitively know what that number is.

37
00:03:28,690 --> 00:03:36,850
‫So if we take that binary value that is and convert decimal that's 162 and if we convert it to the binary

38
00:03:36,850 --> 00:03:49,590
‫code a decimal format becomes 0 0 0 1 0 1 1 0 0 0 1 0 which is 1 6 2 or 162 to notice or in binary code

39
00:03:49,600 --> 00:03:52,030
‫decimal format we're using more bits.

40
00:03:52,030 --> 00:03:56,740
‫However we're making it easier for humans to read and understand it.

41
00:03:56,800 --> 00:04:03,730
‫So in our assignment what we do binary binary counters are much easier to implement the binary code

42
00:04:03,730 --> 00:04:05,850
‫a decimal is a lot easier read.

43
00:04:05,890 --> 00:04:11,740
‫So we're going to create a counter and then create a design to convert that binary count value into

44
00:04:11,740 --> 00:04:14,600
‫a binary coded decimal value.

45
00:04:15,550 --> 00:04:22,200
‫So for our binary to binary code decimal design we are going to use the shift and add 3 algorithm.

46
00:04:22,210 --> 00:04:29,200
‫So for example if we would have at 8 that binary number we would need to 1 shift the binary number left

47
00:04:29,380 --> 00:04:35,740
‫one bit and we would need to do this eight times because our number is 8 bits of 8 shifts have taken

48
00:04:35,740 --> 00:04:36,430
‫place.

49
00:04:36,430 --> 00:04:43,870
‫The binary code a decimal number is in the hundreds tens and units column of the binary value and any

50
00:04:43,870 --> 00:04:46,780
‫one of these columns is 5 or greater.

51
00:04:46,810 --> 00:04:53,920
‫We want to add three to that value in that binary decimal coded column and we'll go back to 1 and just

52
00:04:53,920 --> 00:04:56,750
‫keep doing this until eight shifts have taken place.

53
00:04:57,550 --> 00:05:02,390
‫So let's look at an example where instead of 8 we're going to be doing a forbit value.

54
00:05:02,490 --> 00:05:07,800
‫We're going to convert the hex value d to binary code to decimal.

55
00:05:07,810 --> 00:05:15,830
‫So first to start out we have the hex in hexadecimal value which in binary is 1 1 1 0.

56
00:05:16,060 --> 00:05:17,530
‫And when you shift it four times.

57
00:05:17,540 --> 00:05:24,280
‫However every time we shift we need to check if any number of bits in any one of the columns is greater

58
00:05:24,280 --> 00:05:26,090
‫than 5 or equal to pi.

59
00:05:26,380 --> 00:05:27,530
‫We need to add three.

60
00:05:27,700 --> 00:05:33,330
‫So to start out we'll do our first shift where our units has a value of 1.

61
00:05:33,340 --> 00:05:35,690
‫So nothing is greater than or equal to five.

62
00:05:35,860 --> 00:05:42,140
‫We'll shift again or shift number two and once again nothing is greater than or equal to 5.

63
00:05:42,310 --> 00:05:44,550
‫So you are shift number three.

64
00:05:44,590 --> 00:05:50,940
‫Now at this point after our shift three in our units column The number is greater than 5.

65
00:05:51,070 --> 00:05:53,910
‫So we to add three to that units column.

66
00:05:54,160 --> 00:06:01,460
‫And once we do that our tens call now has a value of 1 in our units column has a value or attends excuse

67
00:06:01,470 --> 00:06:06,400
‫it has a value 0 or unit has a value of 1 0 1 0.

68
00:06:06,400 --> 00:06:08,910
‫Now we want to shift for the fourth time.

69
00:06:09,100 --> 00:06:16,360
‫And when we do this fourth shift we are now in the tens units and we have completed our shift and add

70
00:06:16,360 --> 00:06:22,270
‫three algorithm which gives us in our tens column of 1 in our units column of 4 which is a value of

71
00:06:22,270 --> 00:06:26,360
‫14 which is equal to original value of b.

72
00:06:26,530 --> 00:06:33,400
‫However 14 is much more intuitive and easy to understand for humans as opposed to just saying we or

73
00:06:33,700 --> 00:06:36,590
‫1 1 1 0.

74
00:06:36,770 --> 00:06:39,560
‫Now you know how binary code decimal counter works.

75
00:06:39,590 --> 00:06:40,640
‫Let's go design one.

