Electronics-Chapter4(final version)
Electronics-Chapter4(final version)
technology
Digital circuit
(Chapter 4-6)
Chapter4 Fundamentals of
digital logic
§4.1 Number system and code system
143.65D 110 2 1
4 10 3 10 0
1 2
6 10 5 10
2 、 Binary
Digits : 0 、 1
Carry rule : When two is full, a carry
is occurred.
Base number : 2
k i: coefficient for ith
D k i2i position ;
i
2 :weight of ith position.
10011.11B
12 4 0 23 0 2 2 121 120 12 1 12 2
(19.75)10
3 、 Hexadecimal
Digits : 0 ~
9 、 A(10) 、 B(11) 、 C(12) 、 D(13) 、
Carry E(14)
rule :、 When
F(15)16 is full, a carry
is occurred.
Base number : 16
k i: coefficient for ith
position ;
D k i16 i
i
16 :weight of ith position.
3D.BE H 3 161
13 16 0
11 16 -1
14 16 2
4.1.2 Code system
A set of numbers representing different things is called code
(such as postal code, telephone number, citizen ID number,
student's card number, etc.), and the rules that are followed
when compiling code are called code system.
( Each bit cell“1” representing fixed value : constant weight )
8421
Constant weight
Code code : 5421
classification
Cyclic codes(Gray code )
Invariable weight
Reminder 3 cyclic codes
code :
( Each bit cell“1” doesn't represent fixed value : invariable
weight )
BCD Code : 4 bit binary digits are used to represent one decimal number.
These codes are called binary-to-decimal codes, referred to as
BCD codes.
4 0110
5 0111
6 0101 adjac
ent
7 0100
Eg : 4-bit Cyclic Gray Code
the last two bits
十Decimal
进制数 Graycode
Gray 码 十Decimal
进 制 数 Gray
Gray 码
code
0 0000 8 1100
1 0001 9 1101
2 0011 10 1111
3 0010 11 1110
4 0110 12 1010
5 0111 13 1011
6 0101 14 1001
7 0100 15 1000
The first two bits
§4.2 Basic operations in logic algebra
A mathematical method for describing the logical
relationship of objective things, called Boolean algebra.
Boolean algebra is widely used to solve the analysis and
design of switching circuits and digital logic circuits, so
Boolean algebra is called logic algebra or switching
algebra.
A B
Y
A B Y A B Y
switch off switch off off
0 0 0
Input all
switch on switch off off 1 0 0 are
switch off switch on off 0 1 0 1s , output
is 1.
switch on switch on on 1 1 1
4.2.1 Logic AND Y A B
& A
A Y
Y B
B
0•0=0 0•1=0
1•0=0 1•1=1
“AND”Gate Sign
4.2.2 Logic OR Y A B
B
A Y
A B Y A+B Y
switch off switch off off
0+0=0
switch on switch off on 1+0=1 If input
has
switch off switch on on 0+1=1 1 , output
switch on switch on on 1+1=1 must be 1.
4.2.2 Logic OR Y A B
0+0=0 0+1=1
“OR”gate sign 1+0=1 1+1=1
4.2.3 Logic NOT Y A
A Y
A Y A Y
switch off on 0 1 Not 0 is
switch on off 1 0 1 , not 1
is 0.
4.2.3 Logic NOT Y A
1
A Y A Y
“NOT”gate sign
4.2.4 Compound logic
1 、 NAND operation
Y AB
A B Y &
A
0 0 1 B
Y
0 1 1
1 0 1
A
1 1 0 Y
B
4.2.4 Compound logic
2 、 NOR operation
Y A B
A B Y A
≥1
Y
0 0 1 B
0 1 0
1 0 0 A
Y
1 1 0 B
4.2.4 Compound logic
3 、 eXclusive-OR operation
Y AB A B A B 1
A
Y
A B Y B
0 0 0
0 1 1 A
Y
1 0 1 B
1 1 0
4.2.4 Compound logic
Y A B A B A B
4 、 inclusive-OR logic A B Y
0 0 1
0 1 0
1 0 0
1 1 1
=1 A
Y
B
Outline
• Review of last class
– Digital logic
– Boolean algebra
– And, Not, Or, XOR, Inclusive-or logic operation
– Today's class
– Basic rules and common formulas in digital logic
– Simplification of logic function by formulas
– Simplification of logic function by Karnaugh map
§4.3 Basic rules and common formulas in logic algebra
4.3.1 Basic rules
1. Commutative rule A B B A A B B A
A B C A B C
2. Associative rule
A B C A B C
3. Distributive rule A B C A B A C
A B C A B A C
1. A + AB = A
2.A AB A B
3.AB AC BC AB AC
§4.4 Logical function and its expressions
What's the logical function
If the logical variable is used
as input, and the operation result
is used as output, then the value
of output will be determined when
the input variable is determined.
Therefore, between input and output
is a function, this function is
called logical function.
Y F A, B, C,......
Outline
• Review
– 4.1 Analog signal & digital signal
• Code system (BCD & Gray code)
– 4.2 Basic operations in logic algebra
• AND & OR & NOT & XOR & Clusive OR
– 4.3 Basic rules and common formulas in logic
algebra
• Today's contents
– 4.4 Logical function and its expressions
– 4.5 Logical functions' simplification by
formula
4.4.1 Establishment of logic function
Eg: Three people vote on one thing and the result is decided by the
principle of 'minority is subordinated to the majority. Please build
the logical function to solve the problem.
3 steps to build logical function :
Step 1: defining independent variablesand dependent variables.
The three person's opinion is set as independent variable A, B,
C, and the regulation can only agree or disagree with the two
opinions. The voting result is set as dependent variable Y,
obviously only through or not through two kinds of situations.
Step 2: define the logical value of the variable state. For the
independent variables A, B, C set: agree to logic '1' , do not
agree to logic '0'. For the dependent variable Y: let the vote be
logical '1' and not pass logical '0'.
Step 3: the problem according to the above provisions and
writing logic function.
4.4.1 Establishment of logic function
Eg: three people vote on one thing and the result is decided
by the principle of 'minority is subordinate to the majority',
and the logical function is established.
Truth table
A B C Y See from the truth table, A, B, C
0 0 0 0 when the independent variable
0 0 1 0 definite value, because the value of
0 1 0 0
the variable Y is completely
determined. So, Y is a function of A,
0 1 1 1
B, C. A, B C, often referred to as the
1 0 0 0
input variable, output logic variable
1 0 1 1 called Y.
1 1 0 1
1 1 1 1
4.4.2 Expression of logic function
Expressions of logic function :
Logic state table ( truth table )
Logic function
Logic diagram
Karnaugh map
4.4.2 Expression of logic function
There is a T corridor, a street lamp at the cross point. A
switch is at each corridor of A, B, C, respectively.
Control requirements :
Turning off anyone of switches , Y is on;
Turning off any two of switches, Y is
off;
Turning off all the them, Y is on.
A C
Y
B
4.4.2 Expression of logic function
Control requirements :
Turning off anyone of switches , Y
s on ;
Turning off any two of switches, Y
s off; A C
Turning off all the them, Y is on. Y
Step1 : definition of independent
variable and dependent variable B
B
4.4.2 Expressions of logic function
Logic function formula: the logical relation between the independent
variable and dependent variable is expressed by operators such as "AND",
"OR", "NOT", and so on, that is, the logic function formula.
1 1 1
B
&
≥1
Y
&
Eg: Y ABC BC
NAND logic: if the logical form is composed of all
NADN operations, the logical form is called NAND
logic.
Eg :
F1 AB BD ABD ABCD A B
B BD ABD ABCD
B BD
F1 B D
§4.5 Logical functions' simplification by formula
A AC BD BEF DEFG
F2 A C BD BEF
§4.5 Logical functions' simplification by formula
F3 AB AC BC BC BD B D ADE(F G )
A
AB
A BC BC BD B D
CD
F3 A BC B D CD
§4.5 Logical functions' simplification by formula
F3 AB AC BC BC BD B D ADE(F G )
A
AB
A BC BC BD B D
CD
F3 A BC BD CD
§4.5 Logical functions' simplification by formula
Discussion:
F3 AB AC BC BC BD B D ADE(F G )
F3 A BC B D CD
or:
F3 A BC BD CD
not unique
Outline
Last class Today's contents
• 4.3 Expressions of • 4.6 Simplication by
logic functions Karnaugh map
– Truth table&function – 1. Karnaugh map
– diagram&Karnaugh – 2. Simplification
map • Conclusion
• 4.4 Design of logic
circuit
• 4.5 Simplification by
rules
§4.6 Simplification of logic function by Karnaugh map
4.6.1 Expressing logic function by Karnaugh map
1. The form of sum of minimum terms in logical function
Minimum terms
In the n variable logic function, if M is the product item containing N factors,
and the N variables appear in M in the form of the original variable or the
inverse variable, then M is called the minimum item of the group variable.
The minimum item of a N variable should be 2n.
Eg :
Y ABC BC
ABC (A A )BC
m 6 m 7 m 3 mi (i 3,6,7)
i
m(3,6,7)
§4.6 Simplification of logic function by Karnaugh map
m(7,12,13, 14)
§4.6 Simplification of logic function by Karnaugh map
1. The graphics on both sides marked "0" and "1" are the corresponding variable gray
code encoding;
2. Corresponding to the 2 logical variable combination of gray code encoding the
combination of the grid and encoding as "the smallest item “1";
3. The size of the decimal number corresponding to the 3 logical variable gray code
encoding combination is corresponding to the minimum number of;
4. The table contains natural and logical items between the adjacent adjacent. The
table in each row or column of the tail is a logical neighbor.
5 variables ( A 、 B 、 C 、 D 、 E ) minimum items
Eg : 4-bit Cyclic Gray Code
Decimal number Gray code
0 0000
adjacent adjacent
1 0001
2 0011
3 0010 adjacent
4 0110
5 0111
6 0101 adjac
ent
7 0100
2. Expression of logic function by Karnaugh Map
Since any logic function can be expressed as the
number of minimum sum form, it can be said that an
arbitrary logic function by Karnaugh map.
01 1 1
11 1
10 1 1 1 1
4.6.2 Simplification of logic function by
Karnaugh map
Simplification steps :
1.Lay out
3 steps 2.Filling items
CD
AB 00 01 11 10
Logic adjacent: 00 A BC D A BC D A BCD A BC D
Only one variable
is different
between the 01 ABC D ABC D ABCD ABC D
adjacent two
items.
11 AB C D ABC D ABCD ABC D
10 A BC D A BC D A BCD A BC D
( 8421
Minimum item code
According )
to decimal number : m0 m15
Low bits
CD D
AB 00 01 11 10
High bits
00 m0 m1 m3 m2
01 m4 m5 m7 m6
B
11 m12 m13 m15 m14
A
10 m8 m9 m11 m10
C
2. Filling in items
expressing logic function by karnaugh
map
C
例 1: Y1 (A, B, C, D) A B BD ABD ABCD A B
Brush D
items : CD
filling items they A B 00 01 11 10
have common
factors into
proper grids 00
01 1 1
Commom item:
B
BD 11 1 1
A
10
C
Eg1: Y1 (A, B, C, D) A B BD ABD ABCD A B
CD D
AB 00 01 11 10
00 1 1 1 1
01 1 1
B
11 1 1
A
10 1 1 1 1
C
Eg1: Y1 (A, B, C, D) A B BD ABD ABCD A B
CD D
AB 00 01 11 10
00 1 1 1 1
01 1 1
B
11 1 1
A
10 1 1 1 1
C
If all the itmes have been filled into the proper
grids, then finished.
3. Draw circles to simplify by Karnaugh
map
Methods: the adjacent square lattices with the value of ‘1’
were rectangular or square, and the adjacent small squares
included the small squares adjacent to the logic.
Note :
1. Circles are as large as possible, that is, the number of circles should
be minimal, the number of '1's in a circle should be the most ;
2. The number of '1' in a circle should be 2n;
3. When a new circle is added, it must contain at least one '1' that
has not appeared in any circle drawed before;
4. No '1' left, simplification is finished.
例 1: Y1 (A, B, C, D) A B BD ABD ABCD A B
Y1 (A, B, C, D) B D
CD
AB 00 01 11 10
00 1 1 1 1
Common
D:
factor 01 1 1
Common
11 1 1
factor:
B
10 1 1 1 1
Y2 ( A, B, C , D) AB BC D ABD ABC D
Filling : CD D
AB 00 01 11 10
00
01 1
B
11 1
A
10 1 1 1 1
C
Y2 ( A, B, C , D) AB BC D ABD ABC D
CD D
AB 00 01 11 10
00
01 1 1
B
11 1 1 1
A
10 1 1 1 1
C
Y2 ( A, B, C , D) AB BC D ABD ABC D
Y ( A, B, C , D) AC AB BC AD
2
CD D
AB 00 01 11 10
00
BC
01 1 1
AD B
11 1 1 1
redundant
A
item 10 1 1 1 1
AC
C AB
Y2 ( A, B, C , D) AB BC AD
Eg2 : The simplified Y3 is computed by formula. Is it the simplest form?
If not, please simplify it by Karnaugh map.
Y3 ( A, B, C ) AB AC AB BC
C
BC00 01 11 10
A
0 1 1
1 1 1
B
Y3 ( A, B, C ) AB AC AB BC
C
BC00 01 11 10
A
0 1 1 1
1 1 1 1
B
Y3 ( A, B, C ) AB AC AB BC
BC
AC
BC00 01 11 10
A
0 1 1 1
1 1 1 1
AB
Y3 ( A, B, C ) AB AC BC
Y3 ( A, B, C ) AB AC AB BC
Y3 ( A, B, C ) AB AC BC
BC AB
BC00 01 11 10
A
0 1 1 1
1 1 1 1
AC Y3 ( A, B, C ) AC BC AB
BC
A 00 01 11 10
0 1 1 1
1 1 1 1
Y3 ( A, B, C ) AB AC BC
BC
A 00 01 11 10
0 1 1 1
1 1 1 1
Y3 ( A, B, C ) AC BC AB
F A CD BC B D BCD
Note :
1. Each circle should contain as many '1's as
possible, at the same time, avoid redundant
items.
3. Y ( A, B, C , D) ( m1 , m2 , m4 , m7 , m8 , m9 , m12 , m15 )
4. Y ( A, B, C ) ( m1, m2 , m4 , m5 , m6 , m7 )
5. Y ( A, B, C ) AB AC AB BC
1.Y ( A, B, C , D ) AB BC D ABD ABCD
AB AC BC AD 2. Y ( A, B, C , D) m (1,4,6,8,9,10,11,13,15)
AB AD BCD BCD ABCD
CD CD
00 01 11 10 00 01 11 10
AB AB
00 00 1
01 1 1 01 1 1
11 1 1 1 11 1 1
10 1 1 1 1 10 1 1 1 1
3. Y ( A, B, C , D) ( m1, m2 , m4 , m7 , m8 , m9 , m12 , m15 )
ABC BC D BCD BCD ABC D
CD
00 01 11 10
AB
00 1 1
01 1 1
11 1 1
10 1 1
BC
A 00 01 11 10
4. Y ( A, B, C ) ( m1 , m2 , m4 , m5 , m6 , m7 )
0 1 1 A BC BC
1
1 1 1 1
BC
A 00 01 11 10
5. Y ( A, B, C ) AB AC AB BC
0 1 1 1 A B C
1 1 1 1 1