0
1
00:00:01,630 --> 00:00:07,060
The binary code is the underlying of all computation in logic design. However, decimal numbers are 
1

2
00:00:07,060 --> 00:00:12,910
more convenient for human and can easily be shown by 7-segments. To cope with decimal arithmetic, 
2

3
00:00:12,940 --> 00:00:17,570
designers usually use special coding mechanism such as Binary Coded Decimal (BCD).
3

4
00:00:18,460 --> 00:00:23,620
This lecture explains this coding approach and how to convert a binary number into the equivalent 
4

5
00:00:23,620 --> 00:00:26,230
BCD to be shown on 7-segment displays.
5

6
00:00:28,730 --> 00:00:33,270
In the BCD coding technique, each decimal digit is shown by a four-bit code.  
6

7
00:00:33,830 --> 00:00:36,740
This code contains the binary representation of the digit.
7

8
00:00:37,220 --> 00:00:43,680
For example, the binary representation of 24 is 00011000; 
8

9
00:00:43,850 --> 00:00:50,090
however, its BCD code is the concatenation of the BCD codes for digits 2 and 4, which are
9

10
00:00:50,090 --> 00:00:56,630
their 4-bit binary code. Converting a binary number into the equivalent BCD and then to the 
10

11
00:00:56,630 --> 00:00:58,690
7-segment code is the goal of this lecture. 
11

12
00:01:01,030 --> 00:01:07,510
A 4-bit BCD can represent a decimal digit. However, there are two ways to save the code: using 4 
12

13
00:01:07,510 --> 00:01:14,020
bits (or a nibble) which is called packed BCD or using 8 bits (or a byte) which is called unpacked 
13

14
00:01:14,020 --> 00:01:18,880
BCD. In the 8 bits, the upper 4 bits are zero.
14

15
00:01:19,690 --> 00:01:26,020
The two different BCD representations of 12 are shown in this figure. Whereas the unpacked 
15

16
00:01:26,020 --> 00:01:27,880
BCD requires two bytes, 
16

17
00:01:27,880 --> 00:01:31,150
the packed BCD needs only one byte of memory. 
17

18
00:01:32,850 --> 00:01:38,790
This table shows the 1-digit packed BCD codes for numbers from 0 to 9. and this one shows
18

19
00:01:38,790 --> 00:01:40,040
the 2-digit packed 
19

20
00:01:40,050 --> 00:01:43,260
BCD codes for numbers from 10 to 99.
20

21
00:01:46,400 --> 00:01:52,610
Designing a digital circuit to convert a binary code into its equivalent BCD would be our next topic.
21

22
00:01:52,970 --> 00:01:58,170
In the following lectures, I will explain two different methods to address this problem in HLS.
22

23
00:01:58,760 --> 00:02:00,320
These are the takeaway messages.
23

24
00:02:01,100 --> 00:02:03,470
BCD coding represents the decimal numbers.
24

25
00:02:04,010 --> 00:02:07,610
There are two types of BCD representation: packed and unpacked.
25

26
00:02:09,220 --> 00:02:13,420
Now the quiz for this lecture Find the BCD code for the binary number.
