Professional Documents
Culture Documents
Introduction
Professor Chien-Mo James Li
Graduate Institute of Electronics Engineering
National Taiwan University
Logic Design
NTUEE C.M. Li
Outline
Introduction
Digital Systems and Switching Circuits.
Number Systems and Conversion.
Binary Arithmetic.
Representation of Negative Numbers.
Binary Codes.
Logic Design
NTUEE C.M. Li
Course Objective
Give you the FIRST key to the digital world
Logic Design
NTUEE C.M. Li
The Babbage
Difference Engine
(1832)
2,500 parts
Logic Design
NTUEE C.M. Li
Logic Design
NTUEE C.M. Li
Logic Design
NTUEE C.M. Li
Bipolar logic
1960s
Logic Design
NTUEE C.M. Li
Logic Design
NTUEE C.M. Li
1-10 gates
MSI (Medium Scale Integration) late 1960
10-100 gates
LSI (large Scale Integration 1970
100-10,000 gates
VLSI (Very Large Scale Integration) 1980
> 10,000 gates
NTUEE C.M. Li
Logic Design
Digital Everywhere
Computer
Communication
Consumer electronics
Logic Design
NTUEE C.M. Li
10
Logic Design
NTUEE C.M. Li
11
Outline
Introduction
Digital Systems and Switching Circuits.
Number Systems and Conversion.
Binary Arithmetic.
Representation of Negative Numbers.
Binary Codes.
Logic Design
NTUEE C.M. Li
12
Analog Systems
Logic Design
NTUEE C.M. Li
13
Digital systems
Possible to produce exact and correct outputs
Accuracy can be improved easier than analog systems
10 bit to 20 bit is easy
Analog systems
Susceptible to noise, component imperfection
Accuracy hard to improve
Due to component limitation
Logic Design
NTUEE C.M. Li
14
NTUEE C.M. Li
Logic Design
15
Overall comparison
Digital systems prevail because of
Affordable price
Quality
Easy to maintain
Computers
Telephone
Video
.. You name one
Logic Design
NTUEE C.M. Li
16
Logic Design
Circuit Design
Logic Design
17
CPU
Memory
Hard drive
Logic Design
NTUEE C.M. Li
18
NTUEE C.M. Li
Logic Design
19
PMOS
NMOS
Logic Design
NTUEE C.M. Li
20
Switching Circuit
A switching circuit has one or more inputs and one or more outputs
which take on discrete values
Inputs
X1
X2
Z1
Z2
Xm
Zn
Outputs
Logic Design
NTUEE C.M. Li
21
Why Switching ?
Logic Design
NTUEE C.M. Li
22
In general
Logic Design
NTUEE C.M. Li
23
Why Combinational?
Logic Design
NTUEE C.M. Li
24
Switching Devices
Switching devices used in a switching circuit are generally two-state
devices
Diode (conduct, non-conduct)
Transistors (cut-off, saturate) amplifiers are not two-state
Relay (close, open)
Logic Design
NTUEE C.M. Li
25
Outline
Logic Design
NTUEE C.M. Li
26
Number Systems
Any positive integer R (R>1) can be chosen as base
Logic Design
NTUEE C.M. Li
27
Conversion (1)
Conversion from Radix R to decimal
Q1: Base 12
How many inches is 5 6 ?
Q2: Base 13
Aliens who have 13 fingers can use base 13 system
How many is 5313 in decimal?
Examples on P.9
Logic Design
NTUEE C.M. Li
28
Conversion (2)
Conversion from decimal integer to radix R
Rule (p.9)
N=
N/R=
Q1/R=
Example
Convert 5310 to binary (p.10)
Logic Design
NTUEE C.M. Li
29
Conversion (3)
Conversion from decimal fraction to radix R
Rule (p.10)
F=
FR=
F1R=
Example
Convert .62510 to binary
(p.11)
Example
Convert 0.710 to binary
(p.11)
Logic Design
NTUEE C.M. Li
30
Conversion (4)
How to convert radix R1 to radix R2 ?
Logic Design
NTUEE C.M. Li
31
Outline
Logic Design
NTUEE C.M. Li
32
Binary Arithmetic
Addition
P. 13
Subtraction
P. 13
Multiplication
P.14
Division
P. 15
Logic Design
NTUEE C.M. Li
33
Outline
Logic Design
NTUEE C.M. Li
34
Negative Numbers
Three representations of negative number -N
35
NTUEE C.M. Li
Logic Design
Example (n=4)
TABLE 1-1
Note
+N
positive
-N
Sign &
Mag.
2C
1C
+0
0000
-0
1000
----
1111
+1
0001
-1
1001
1111
1110
+2
0010
-2
1010
1110
1101
+3
0011
-3
1011
1101
1100
+4
0100
-4
1100
1100
1011
+5
0101
-5
1101
1011
1010
+6
0110
-6
1110
1010
1001
+7
0111
-7
1111
1001
1000
-8
----
1000
----
+8
Logic Design
NTUEE C.M. Li
36
Easy calculation of 1C
TABLE 1-1
+N
positive
-N
Sign &
Mag.
2C
1C
+0
0000
-0
1000
----
1111
+1
0001
-1
1001
1111
1110
+2
0010
-2
1010
1110
1101
+3
0011
-3
1011
1101
1100
+4
0100
-4
1100
1100
1011
+5
0101
-5
1101
1011
1010
+6
0110
-6
1110
1010
1001
+7
0111
-7
1111
1001
1000
-8
----
1000
----
+8
NTUEE C.M. Li
Logic Design
Easy Calculation of 2C
N* = N_ +1
Complement all bits to the left of first (rightmost) 1
+N
positive
-N
Sign &
Mag.
2C
1C
+0
0000
-0
1000
----
1111
+1
0001
-1
1001
1111
1110
+2
0010
-2
1010
1110
1101
+3
0011
-3
1011
1101
1100
+4
0100
-4
1100
1100
1011
+5
0101
-5
1101
1011
1010
+6
0110
-6
1110
1010
1001
+7
0111
-7
1111
1001
1000
-8
----
1000
----
+8
Logic Design
NTUEE C.M. Li
38
Addition of 2C
Add 2C numbers just as if all numbers were positive
Case 1, 3, 4, 5
No overflow
Case 2, 6
overflow
NTUEE C.M. Li
Logic Design
39
Logic Design
NTUEE C.M. Li
40
Case 4
A* + B =
Case 5 (P.19)
A* + B* =
Logic Design
NTUEE C.M. Li
41
Addition of 1C
Similar to 2C, but
Case 3, 4, 5
No overflow
Case 6
overflow
Logic Design
NTUEE C.M. Li
42
NTUEE C.M. Li
Logic Design
43
(-11) + (-20) in 1C
(-8) + (+19) in 2C
Logic Design
NTUEE C.M. Li
44
Bad Memory?
cant remember so many rules
Logic Design
NTUEE C.M. Li
45
Outline
Logic Design
NTUEE C.M. Li
46
Binary Codes
Although internally use binary Decimal 8-4-2-1 6-3-1-1 Excess-3 2-out Gray
Digit
Code
(BCD)
Code
Code
-of-5
Code
Code
0000
0000
0011
00011
0000
0001
0001
0100
00101
0001
0010
0011
0101
00110
0011
0011
0100
0110
01001
0010
0100
0101
0111
01010
0110
0101
0111
1000
01100
1110
0110
1000
1001
10001
1010
0111
1001
1010
10010
1011
1000
1011
1011
10100
1001
1001
1100
1100
11000
1000
47
NTUEE C.M. Li
Logic Design
Example
How to represent 937 ?
decimal
BCD
1001
0011
0111
6-3-1-1
1100
0100
1001
Excess 3
1100
0110
1010
Logic Design
NTUEE C.M. Li
48
Features of codes
BCD & 6-3-1-1 are weighted codes
Excess 3 code = 8-4-2-1 code + 3 (0011)
2-out-of-5 code
Gray code
Logic Design
49
Logic Design
NTUEE C.M. Li
50
Big 5 code
UTF code
GB code
.
Logic Design
NTUEE C.M. Li
51
Review
Logic Design
NTUEE C.M. Li
52
Next Time
ch 1 Introduction Number Systems
and Conversion
ch 2 Boolean Algebra
ch 3 Boolean Algebra (contd)
ch 4. Application of Boolean Algebra
ch 5 Karnaugh Maps
ch 7 Multi-Level Gate Circuits;
NAND NOR Gates
ch 8 Combinational Ckt Design
Logic Design
NTUEE C.M. Li
53