344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and...

26
Chapter 4 Digital Logic Circuits 344-521 กก Computer Organization and Architecture

Transcript of 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and...

Page 1: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

Chapter 4 Digital Logic Circuits

344-521 ��� �ก������������ก ��������� �Computer Organization and Architecture

Page 2: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 2

Digital Computers

� A digital system that performs various computational tasks

� Use binary number system (0 or 1)� A binary digit is called a bit

Page 3: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 3

Logic Gates

� Binary information is represented in digital computers by physical quantities called signals

� Digital Signals have two basic states:1 (logic “high”, or H, or “on”)0 (logic “low”, or L, or “off”)

� Digital values are in a binary format. Binary means 2 states.

� A good example of binary is a light (only on or off)

Page 4: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 4

� Manipulation of binary information is done by logic circuits called gates.

� Gates are blocked of hardware that produce signals of binary 1 or 0.

� Digital logic gates can be described in terms of standard logic symbols and their corresponding truth tables.

Logic Gates (cont’d)

Page 5: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 5

Boolean Algebra

� An algebra that deals with binary variables and logic operations� Variables: A, B, x, y� Operations: AND (�), OR (+), or ¯

� Purpose: to facilitate the analysis and design of digital circuits

Page 6: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 6

Boolean Function

� Can be either 1 or 0� Example: F = x+y z

F = 1 if x =1 or if (y and z) = 1

� Relationship between function and binary variables can be represented in truth table� Need a list of the 2n combinations of the n binary

variables.

� A Boolean function can be transformed an algebraic expression into a logic diagram composed of AND, OR, and inverter gates

Page 7: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 7

Most Basic Identities of Boolean Algebra

1. A+0 = A2. A�1 = A

3. A+1 = 14. A+A = 15. A�0 = 06. A�A = 0

7. A+A = A8. A�A = A

9. A+B= B+A10.AB = BA

11.A+(B+C) = (A+B)+C12.A(BC) = (AB)C13.A+(BC) = (A+B)(A+C)14.A(B+C) = (AB)+ (AC)15.A = (A )16.A+AB = A17.A(A+B) = A18.A+A B = A+B19.A(A +B) = AB20.DeMorgan’s theorem

� (A+B) = A B

� (AB) = A +B

Page 8: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 8

Digital Logic Gates

Page 9: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 9

Digital Logic Gates (cont’d)

Page 10: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 10

Digital Logic Gates (cont’d)

Page 11: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 11

DeMorgan’s Theorem

� Very important in dealing with NOR and NAND gates.

Figure Two graphic symbols for NOR gate

Figure Two graphic symbols for NAND gate

Page 12: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 12

DeMorgan’s Theorem

� Example: F = ABC + ABC + A C

Page 13: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 13

DeMorgan’s Theorem (cont’d)

� F = ABC + ABC + A C= AB(C+C ) + A C = AB + A C

Page 14: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 14

Circuit Simplification

� � � ����!"ก� �# $�%�&�ก��'"

1. Use Boolean Algebra

2. Use map called Karnaugh map or K-map3. Use Variable Entered Map4. Use Quine McCluskey - �'��� ��ก ( + &�ก��'"*+

��กก�,� 1 output

Page 15: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 15

Circuit Simplification: use Boolean Algebra

� Example 1: �# $�&�ก��'" Y = AB+AB +A B��-+*.� Y = AB+AB +A B

=

Page 16: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 16

Circuit Simplification: use Boolean Algebra (cont’d)

� Example 2: �# $�&�ก��'" Y = (A +AB )(A B )��-+*.�

Page 17: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 17

� A pictorial arrangement of the truth table which allows an easy interpretation for choosing the minimum number of terms needed to express the function algebraically.

� Each combination of the variables in a truth table is called a minterm.

� In a truth table, a function of n variables will have 2n

minterms� Information in a truth table is in compact form by

listing the decimal equivalent of those minterms that produce a 1 for the function.

Circuit Simplification: use K-map

Page 18: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 18

� Example: F (x,y,z) = Σ (1,4,5,6,7)

� The letters in parentheses list the binary variables in the orfer that they appear in the truth table.

� The symbol Σ stands for the sum of the minterms that follow in parentheses.� Minterms that produce 1 for the function are listed in

their decimal equivalent; otherwise produce 0.

� The map is a diagram made up of squares, with each square representing one minterm.

Circuit Simplification: use K-map (cont’d)

Page 19: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 19

Circuit Simplification: use K-map (cont’d)

Page 20: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 20

� Example 1: F(A,B,C) = Σ (3,4,6,7)� Example 2: F(A,B,C) = Σ (0,2,4,5,6)� Example 3: F(A,B,C,D) = Σ (0,1,2,6,8,9,10)

Circuit Simplification: use K-map (cont’d)

Page 21: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 21

Don’t Care Condition

� There are occasions when it does not matter if the function produces 0 or 1 for a given minterm.

� Then, we don’t care what the function output is to be for the minterm.

� This minterm is called don’t care condition � Mark with x in the map� Used to provide further simplification of the

algebraic expression.

Page 22: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 22

� Example: F(A,B,C) = Σ (0,2,6)d(A,B,C) = Σ (1,3,5)

Don’t Care Condition (cont’d)

Page 23: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 23

Combinational Circuits

� A connected arrangement of logic gates with a set of inputs and outputs

Figure Block diagram of a combinational circuit

Page 24: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 24

Half-Adder

Page 25: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 25

Full-Adder

Map for full-adderTruth table for full-adder

Page 26: 344-521 ก ˘ก ˇˇ ˆ˙˝˛ Computer Organization and Architecturestaff.cs.psu.ac.th/ladda/subjects/344-521/ppt2pdf/chapter4_1.pdf · Computer Organization and Architecture ˝˙˚

���� 344-521 26

Full-Adder (cont’d)

Full-adder circuit