51013 數位系統導論 (EE2016-B) Chapter 1 2021Sept14th (by E Ray) Ver3
51013 數位系統導論 (EE2016-B) Chapter 1 2021Sept14th (by E Ray) Ver3
51013 數位系統導論 (EE2016-B) Chapter 1 2021Sept14th (by E Ray) Ver3
數位系統導論
Fundamentals of Logic Design-Chapter 1:
Introduction Number Systems and Convention
Prof. E Ray Hsieh 謝易叡 助理教授
2 9/22
Ch. 1 & Ch.2-Boolean Algebra
(新生開課週) 9/24
9/29
Agenda 3
10/01
Ch. 2 & Ch.3-Boolean Algebra (II)
Agenda 14
12/15
12/17
Ch. 11 &
Ch. 12- Registers and Counters
(III) 12/22 Ch. 12 &
15 Ch. 13- Analysis of Clocked Sequential Circuits
12/24
12/29 Ch. 13- Analysis of Clocked Sequential Circuits
16
12/31 開國紀念日 補假一天
01/05 彈性運用
17
01/07 Final (Ch. 11~Ch. 13)
18 01/14 Demo of Final-project
Fundamentals of Logic Design-Chapter 1:
Introduction Number Systems and Convention
1.1 Digital systems and switching circuits (p.6)
•The design of digital system can be
divided into three parts: system design,
logic design and circuit design.
•System design involves partitioning the
entire system into subsystems and
setting the characteristics of each
subsystem.
1.1 Digital systems and switching circuits (p6)
• Logic design includes examples of deciding how to
link basic logical architecture blocks inside to
perform specific functions, such as determining the
internal links of logical gates and orthotics to
perform binary additions.
• Circuit design includes specifying internal links to
specific components, such as resistors, diodes, and
transistors, to form logic gates, or transverses, or
other logical schema blocks.
1.1 Digital systems and switching circuits (p7)
• Many subsystems of digital systems take the form of Switching circuits,
which have one or more discrete input and output values.
•
• In this book, you'll learn about two types of switching circuits:
combined and sequential.
Hex to Oct to Dec to Binary Conversion (補充)
23 22 21 20 23 22 21 20
=
=
=
=
=
=
=
=
1.2 Digital systems and transformations (p8)
• Positional notation
Power of 10:
953.7810 9 102 5 101 3 100 7 101 8 102
Power of 2:
1011.112 1 23 0 22 1 21 1 20 1 21 1 22
8 0 2 1 12 14 11 43 11.7510
1.2 Digital systems and transformations (p9)
• Power of R:
• Any positive integer R (R > 1) can be used as a base of a digital
system
00 0
0 1 1
1 0 1
11 0 同時進位1到下一行
1.3 Binary arithmetic (p13)
• Add 1310 to 1110 in binary :
1 1 1 1
進位
1310 1101
1110 1011
11000 2410
1.3 Binary arithmetic (p13)
• The subtraction table for the binary digits is as follows::
00 0
0 1 1 同時從上一行借位1
1 0 1
11 0
1.3 Binary arithmetic (p13)
(a)
02 (從第3行借位)
11101 11101
10011 10011
= 01010 = 01010
(p13)
(b) 10000 12
00011 12 12
=
12 12 12
02 02 02 02
10000 10000 10000 10000
00011 00011 00011 00011
= = = = 01101
(c) 111001 (p13)
001011
= 12
02 02
111001 111001 111001
001011 001011 001011
= 0 = 0 = 110
(c) (p13)
02 02
12 12 12
02 02 02
111001 111001 111001
001011 001011 001011
= 110 = 1110 = 101110
(補充)
(d) 010110
011011
=
02 02
02 02 02 02
010110 010110 010110
011011 011011 011011
= 1 = 011 = 1 011
(d) 010110
011011
02 02 =
沒得借 02 02 沒得借 02 02
1110=10112
1011 10010001
1.3 Binary arithmetic (p15)
• The following example illustrates the binary division of
14510 divided by 1110: 後退一位
1 12 1
1011 10010001 1011 10010001
02
1011 01011
1001 補0
1011
? 1 10
不可以小減大,
只能大減小。
1.3 Binary arithmetic (p15)
後退一位
12
1
1011 10010001 12 12
01011 02 02 02 02 02 02 02
補0
10010 10010 10010 10010
01011 01011 01011 01011
1 1 1 00111
1.3 Binary arithmetic (p15)
後退一位
11
1011 10010001 02 02
01011 02 02 02
補0
001110 001110 001110 001110
001011 001011 001011 001011
000011 1 011 000011
1.3 Binary arithmetic (p15)
後退一位
11 0 11 0 1
1011 10010001 1011 10010001
01011 01011
補0
001110 001110
001011 001011
00001101 00001101
1011
10
1.4 The number of the complement method (p16)
• 2 Supplement system:
• A positive N notation is a size N that is represented by a symbol + a
size method.
• Negative number (- N) is expressed in its 2 complement N.
• If the word group length is n bits, the 2 complement (N*) of the positive
integer N is defined as follows:
Table 1-1 shows the result of n-4, and as shown in Table 1-1, the negative
number of the 2 complement method from -1 to -7 can be obtained by
taking the 2 complements of its positive numbers 1 to 7 (i.e. minus 16).
1.4 Representation of negative numbers (p16)
“1”: 負號
N “0”: 正號
(2n-N)
缺點: Digits減少,可表示的數字範圍變少。
1.4 Representation of negative numbers (p16)
N
-N
10000 – 00000=10000
10000 – 00001=01111 1111 -1
10000 – 00010=01110 1110 -2
10000 – 00011=01101 1101 -3
10000 – 00100=01100 1100 -4
10000 – 00101=01011 1011 -5
10000 – 00110=01010 1010 -6
10000 – 00111=01001 1001 -7
1.4 Representation of negative numbers (p16)
1’s complement:
0變1,1變0
1.4 Addition of 2’s complement numbers (p17)
• The addition of n-bit binary numbers (signed binary numbers).
• If n is 4,
• The two positive numbers are added together, and < 2n-1.
3 0011
4 0100
7 0111 (正確解)
1.4 Addition of 2 complement numbers (p17)
• The two positive numbers add up, and 2n 1
Correction
負號
overflow
(補位)
由於溢位,所以答案錯誤
( 包括符號共須 位元方能表示) (更正 -> 多一個最左邊的digit)
“溢位”就要”補位”
1.4 Addition of 2’s complement numbers (p18)
• The positive and negative numbers are added (when the value
of the negative number is larger).
5 0101
負號 6 1010
1 1111 (正確解)
2補數還原: 10000-01111= 00001 (正數) * (-1)
(看到2補數負數要還原成正數再加負號)
1.4 Addition of 2’s complement numbers (p18)
• The two negative numbers are added, and > 2n -1.
(補位)
Correction
由於溢位,所以答案錯誤 “溢位”就要”補位”
(−11包括符號共須5位元方能表示) 11
2補數還原: 100000-010101= 0001011 (正數) * (-1)
-11
1.4 Addition of 2’s complement numbers (p18)
When the sum < 2n-1,
this sum is the final answer.
N (2 1) N
n
(1-4)
“-0”和“+0”表示法不
一樣
1補數的負數的最
左邊位元皆為1
0變1,1變0
1.4 Addition of 1’s complement numbers (p19)
• The addition of 1 complement numbers is very similar to the
addition of 2 complements, except that
“the addition of 1 complements does not abandon
the final digit but adds the incoming bit to the n-
bit sum of the minimum bits, which is called end-
around carry.” (末位遞迴進位)
1.4 Addition of 1’s complement numbers (p19)
• The case of positive sum is exactly the same as in Examples 1 and 2 of the 2
complements, with the other examples described below (n=4).
Eq. 1 The positive and negative numbers are added (when the value of
the negative number is larger).
(正確解)
1補數還原: 1110 0001 * (-1) -1
(01)
1.4 Addition of 1’s complement numbers (p19)
When the positive value is larger.
5 1010
(溢位)
6 0110
Step1: 1 0000
Step2: 1 (末位遞迴進位)
Step3: 0001 (正確解,沒有溢位)
1.4 Addition of 1’s complement numbers (p20)
The two negative numbers are added, and < 2n-1.
3 1100
4 1011
-7 1 0111
(溢位) 1 (末位遞迴進位)
1000 (正確解,沒有溢位)
1補數還原: 1000 0111 * (-1) -7
(01)
1.4 Addition of 1’s complement numbers (p20)
The two negative numbers are added, and > 2n-1.
(補位)
5 1010
6 1001
-11 1 0011 Correction
-11
1 (末位遞迴進位)
(溢位) 0100 (錯誤解,因為有溢位)
1補數還原: 10100 01011 * (-1) -11
(01)
1.4 Addition of 1’s complement numbers (p20)
The two positive numbers are added, and > 2n-1.
Correction (補位)
+8 < +11 -4 of 1’
+16> +11 (正確解)
(溢位)
1.4 Addition of 1’s complement numbers (p20)
When the sum < 2n-1,
the end-around carry. (末位遞迴進位)
=
1.4 Addition of 1’s complement numbers (p20)
A=5 = -5
B=6 = -6
+
(補位) (正確解)
11000110010011
1’
=A+B=5+6=11
1.4 Addition of 1’s complement numbers (p21)
The following example illustrates the addition of 1 complement
when the length of the word group n is 8 respectively:
The addition of -11 and -20 is performed by 1 complement.
1: +11 = 00001011; 3: 11110100 (11)
+20 = 00010100
11101011 (20)
2: Take the 1 complement
1 11011111
11 11110100;
1 (末位遞迴進位)
20 11101011
11100000 31
(01)
1.5 Encoded Binary Codes and 美國資訊交換標
準碼(American Standard Code for Information
Interchange, ASCII)
(p23)
Table 1-3 lists a portion of the ASCII code that is not listed as a (p23)
0= 0 0 0 0
BCD 1= 0 0 0 1
6-3-1-1 2= 0 0 1 1
3= 0 1 0 0
Codes 4= 0 1 0 1
5= 0 1 1 1
6= 1 0 0 0
7= 1 0 0 1
8= 1 0 1 1
9= 1 1 0 0
Decimal 2 out 5 codes
2 0= 0 0 0 1 1
Out 1= 0 0 1 0 1
2= 0 0 1 1 0
5 3= 0 1 0 0 1
Codes 4= 0 1 0 1 0
5= 0 1 1 0 0
(你跑我追) 6= 1 0 0 0 1
7= 1 0 0 1 0
(補充) 8= 1 0 1 0 0
9= 1 1 0 0 0
Gray Codes (補充)
Gray code after Frank Gray, is an ordering of the binary
numeral system such that two successive values differ in
only one bit (binary digit).
Encoding Method:
1. Keep MSB of the binary;
2. Comparing two neighboring bits:
a. if same (S), produce “0”
b. if different (D), produce “1”
D S
Gray
4= 0 1 0 0 0 1 1 0 Frank Gray (13 September
codes 1887 – 23 May 1969)
D
(補充) Decimal Binary Gray
0= 0 0 0 0 0000
1= 0 0 0 1 0001
2= 0 0 1 0 0011
3= 0 0 1 1 0010
Gray Codes 4= 0 1 0 0 0110
5= 0 1 0 1 0111
6= 0 1 1 0 0101
7= 0 1 1 1 0100
8= 1 0 0 0 1100
9= 1 0 0 1 1101
(補充)
Gray Codes
Encoding Method:
The Symmetric Approach