chap01 digital logic circuits - sangjidblab.sangji.ac.kr/downloads/csa/chap01.pdf3 instruction set...

75
Chap. 1 Digital Logic Circuits Computer System Architectures Database Lab. University of SANGJI University

Upload: others

Post on 24-Mar-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Chap. 1 Digital Logic CircuitsComputer System Architectures

Database Lab.University of SANGJI University

Page 2: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

2

What Is Computer Architecture?Computer Architecture =

Instruction Set Architecture + Machine Organization

Page 3: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

3

Instruction Set Architecture• ISA = attributes of the computing system as seen by

the programmer– Organization of programmable storage– Data types & data structures– Instruction set– Instruction formats– Modes of addressing– Exception handling

Page 4: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

4

Machine Organization• Capabilities & performance characteristics of

principal functional units (e.g., registers, ALU, shifters, logic units)

• Ways in which these components are interconnected

• Information flow between components

• Logic and means by which such information flow is controlled

Page 5: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

What is “Computer”• A computer is a machine that performs computational

tasks using stored instructions.

Page 6: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

A computer consist of … ?

1) Central processing unit (CPU);

2) Random access memory (RAM);

3) Input-output processors (IOP).

• These devices communicate to each other through a set of electric wires called bus.

Page 7: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

CPU consists of

• > Arithmetic logic unit (ALU): Executes arithmetic (addition, multiplication,...) and logical (AND, OR,...) operations.

• > Control unit: Generates a sequence of control signals (cf. traffic signal) telling the ALU how to operate; reads and executes microprograms stored in a read only memory (ROM).

• > Registers: Fast, small memory for temporary storage during mathematical operations.

Page 8: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

RAM stores

• > Program: A sequence of instructions to be executed by the computer

• Data

Page 9: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

9

History of Computers

• The world’s first general-purpose electronic computer was ENIAC built by Eckert and Mauchly at the University of Pennsylvania

during World War II. However, rewiring this computer to perform a new task requires

days of work by a number of operators.

Page 10: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

10

• The first practical stored-program computer was

• EDSAC built in 1949 by Wilkes of Cambridge University.

• Now the program in addition to data is stored in the memory so that different problems can be solved without hardware rewiring anymore.

The first practical stored-program computer

Page 11: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

11

Eckert and Mauchly later went to business, and built the first commercial computer in the United States, UNIVAC I, in 1951.

UNIVAC I

Page 12: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

12

IBM System/360 seriesA commercial breakthrough occurred in 1964 when IBM

introduced System/360 series.

The series include various models ranging from $225K to $1.9M with varied performance but with a singleinstruction set architecture.

Page 13: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

13

Supercomputers

The era of vector supercomputers started in 1976 when Seymour Cray built Cray-1 Vector processing is a type of parallelism which speeds up computation. We will learn related concept of pipelining in this course.

In late 80’s, massively parallel computers such as the CM-2 became the central technology for supercomputing.

Page 14: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

14

Another important development is the invention of the microprocessor--a computer on a single semiconductor chip.

Microprocessors

Page 15: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

15

Microprocessors enabled personal computers such as the Apple II (below) built in 1977 by Steve Jobs and Steve Wozniak.

personal computers

Page 16: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

16

Moore’s Law• In 1965, Gordon Moore predicted that the number of transistors

per integrated circuit would double every 18 months. This prediction, called "Moore's Law," continues to hold true today. The table below shows the number of transistors in several microprocessors introduced since 1971.

Page 17: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

17

Moore’s Law Still Holds

’60 ’65 ’70 ’75 ’80 ’85 ’90 ’95 ’00 ’05 ’10

Tran

sist

ors P

er D

ie

1K4K 16K

64K256K

1M

16M4M

64M

4004

80808086

80286i386™

i486™Pentium®

MemoryMicroprocessor

Pentium® IIPentium® III

256M

Pentium® 4Itanium®

1G2G4G

128M

Source: Intel

108

107

106

105

104

103

102

101

100

109

1010

1011

512M

Page 18: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

0000000000000000011111110000011110001000111110001011011010001011

(a) Analog form (b) Sampled analog form (c) Digital form

Magnetic tape contaning analog and digital forms of a signal.

18

Digital Systems - Analog vs. Digital

•Analog vs. Digital: Continuous vs. discrete.

•Results--- Digital computers replaced analog computers

Page 19: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Digital Advantages• More flexible (easy to program), faster, more precise.

• Storage devices are easier to implement.

• Built-in error detection and correction.

• Easier to minimize.

Page 20: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

20

Binary System• Digital computers use the binary number system.

Binary number system: Has two digits: 0 and 1.

• Reasons to choose the binary system:1. Simplicity: A computer is an “idiot” which blindly

follows mechanical rules; we cannot assume any prior knowledge on his part.

2. Universality: In addition to arithmetic operations, a computer which speaks a binary language can perform any tasks that are expressed using the formal logic.

Page 21: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

ExampleAdding two numbers

High-level language (C)

c = a + b;

Assembly language

LDA 004

ADD 005

STA 006

Machine language

0010 0000 0000 0100

0001 0000 0000 0101

0011 0000 0000 0110

Page 22: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

22

Boolean algebraSince the need is great for manipulating the

relations between the functions that contain the binary or logic expression, Boolean algebra has been introduced.

The Boolean algebra is named in honor of a pioneering scientist named: George Boole.

A Boolean value is a 1 or a 0.A Boolean variable takes on Boolean values. A Boolean function takes in Boolean variables and produces Boolean values.

Page 23: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

23

Boolean or logic operations1. OR. This is written + (e.g. X+Y where X and Y are

Boolean variables) and often called the logical sum. OR is called binary operator.

2. AND. Called logical product and written as a centered dot (like product in regular algebra). AND is called binary operator.

3. NOT. This is a unary operator (One argument), NOT(A) is written A with a bar over it or use ' instead of a bar as it is easier to type.

4. Exclusive OR (XOR).

Written as + with circle around it ⊕. It is also a binary operator.

True if exactly one input is true (i.e. true XOR true = false).

Page 24: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

24

INPUT XOR A⊕B

A B

0 0 0

0 1 1

1 0 1

1 1 0

INPUT OR A+B

A B

0 0 0

0 1 1

1 0 1

1 1 1

INPUT AND A.B

A B

0 0 0 1

0 1 0 1

1 0 0 1

1 1 1 0

TRUTH TABLES

___A.B

Page 25: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

25

Important identities of Boolean ALGEBRA.

Identity: A+0 = 0+A = A A.1 = 1.A = A

Inverse: A+A' = A'+A = 1 A.A' = A'.A = 0 (using ' for not)

+ for OR. for AND

Page 26: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Important identities of Boolean ALGEBRA• Associative:

– A+(B+C) = (A+B)+C – A.(B.C)=(A.B).C

• Due to associative law we can write A.B.C since either order of evaluation gives the same answer.

• Often elide the . so the product associative law is A(BC)=(AB)C

Page 27: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Important identities of Boolean ALGEBRA• Distributive:

– A(B+C)=AB+AC Similar to math.– A+(BC)=(A+B)(A+C) Contradictory to math.

• How does one prove these laws??– Simple (but long) write the Truth Tables for each and

see that the outputs are the same.

Page 28: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

28

Important identities of Boolean ALGEBRA.

Page 29: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Logic GatesFormal logic: In formal logic, a statement (proposition) is

a declarative sentence that is either

true(1) or false (0).

It is easier to communicate with computers using formal logic.

• Boolean variable: Takes only two values – either

true (1) or false (0).

They are used as basic units of formal logic.

Page 30: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Boolean function and logic diagram

• Boolean function: Mapping from Boolean variables to a Boolean value.

• Truth table: – Represents relationship between a

Boolean function and its binary variables. – It enumerates all possible combinations of

arguments and the corresponding function values.

Page 31: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Boolean function and logic diagram• Boolean algebra: Deals with binary variables and logic

operations operating on those variables.

• Logic diagram: Composed of graphic symbols for logic gates. A simple circuit sketch that represents inputs and outputs of Boolean functions.

Page 32: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Gates• Refer to the hardware to implement Boolean

operators.

• The most basic gates are

Page 33: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Boolean function and truth table

Page 34: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

BASIC IDENTITIES OF BOOLEAN ALGEBRA• Postulate 1 (Definition): A Boolean algebra is a closed

algebraic system containing a set K of two or more elements and the two operators · and + which refer to logical AND and logical OR

Page 35: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Basic Identities of Boolean Algebra(Existence of 1 and 0 element)(1) x + 0 = x

(2) x · 0 = 0

(3) x + 1 = 1

(4) x · 1 = 1

(Table 1-1)

Page 36: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Basic Identities of Boolean Algebra (Existence of complement)(5) x + x = x

(6) x · x = x

(7) x + x’ = x

(8) x · x’ = 0

Page 37: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Basic Identities of Boolean Algebra (Commutativity):(9) x + y = y + x

(10) xy = yx

Page 38: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Basic Identities of Boolean Algebra (Associativity):

(11) x + ( y + z ) = ( x + y ) + z

(12) x (yz) = (xy) z

Page 39: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Basic Identities of Boolean Algebra (Distributivity):(13) x ( y + z ) = xy + xz

(14) x + yz = ( x + y )( x + z)

Page 40: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Basic Identities of Boolean Algebra (DeMorgan’s Theorem)(15) ( x + y )’ = x’ y’

(16) ( xy )’ = x’ + y’

Page 41: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Basic Identities of Boolean Algebra (Involution)(17) (x’)’ = x

Page 42: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Function Minimization using Boolean Algebra

• Examples:

(a) a + ab = a(1+b)=a

(b) a(a + b) = a.a +ab=a+ab=a(1+b)=a.

(c) a + a'b = (a + a')(a + b)=1(a + b) =a+b

(d) a(a' + b) = a. a' +ab=0+ab=ab

Page 43: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Try• F = abc + abc’ + a’c

Page 44: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

The other type of question

Show that;

1- ab + ab' = a

2- (a + b)(a + b') = a

1- ab + ab' = a(b+b') = a.1=a

2- (a + b)(a + b') = a.a +a.b' +a.b+b.b'

= a + a.b' +a.b + 0

= a + a.(b' +b) + 0

= a + a.1 + 0

= a + a = a

Page 45: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

More Examples• Show that;

(a) ab + ab'c = ab + ac(b) (a + b)(a + b' + c) = a + bc

(a) ab + ab'c = a(b + b'c)= a((b+b').(b+c))=a(b+c)=ab+ac

(b) (a + b)(a + b' + c) = (a.a + a.b' + a.c + ab +b.b' +bc)

= …

Page 46: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

DeMorgan's Theorem(a) (a + b)' = a'b'

(b) (ab)' = a' + b'

Generalized DeMorgan's Theorem

(a) (a + b + … z)' = a'b' … z'

(b) (a.b … z)' = a' + b' + … z‘

Page 47: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

DeMorgan's Theorem• F = ab + c’d’

• F’ = ??

• F = ab + c’d’ + b’d

• F’ = ??

Page 48: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

DeMorgan's TheoremShow that: (a + b.c)' = a'.b' + a'.c'

Page 49: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

More DeMorgan's example

Show that: (a(b + z(x + a')))' =a' + b' (z' + x')

(a(b + z(x + a')))' = a' + (b + z(x + a'))'= a' + b' (z(x + a'))'= a' + b' (z' + (x + a')')= a' + b' (z' + x'(a')')= a' + b' (z' + x'a)=a‘+b' z' + b'x'a=(a‘+ b'x'a) + b' z' =(a‘+ b'x‘)(a +a‘) + b' z' = a‘+ b'x‘+ b' z‘= a' + b' (z' + x')

Page 50: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

More Examples(a(b + c) + a'b)'=b'(a' + c')

ab + a'c + bc = ab + a'c= AB + A'C + ABC + A'BC .... By expanding BC= AB(1 + C) + A'C(1 + B) .....(1 + C) =1, also (1 + B) = 1= AB + A'C .....Proved

(a + b)(a' + c)(b + c) = (a + b)(a' + c)

..... Using Products of Sums, (A + C)(B + A') = AB + A'C + BC

= (aa’+ac+a’b+bc)(b+c)

= (ac+a’b+bc)(b+c) = abc+a’bb+bbc+acc+a’bc+bcc = abc+a’b+bc+ac+a’bc+bc

= abc+bc+ac+a’b(1+c) = bc(a+1)+ac+a’b = bc+ac+a’b =a’b+bc+ac =(a+b)(a’+c)

Page 51: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Minimization of Boolean expressions• The minimization will result in reduction of

the number of gates (resulting from less number of terms) and the number of inputs per gate (resulting from less number of variables per term)

• The minimization will reduce cost, efficiency and power consumption.

• y(x+x`)=y.1=y• y+xx`=y+0=y• (x`y+xy`)=x⊕y• (x`y`+xy)=(x⊕y)`

Page 52: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Minimum SOP and POS

• The minimum sum of products (MSOP) of a function, f, is a SOP representation of f that contains the fewest number of product terms and fewest number of literals of any SOP representation of f.

Page 53: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Minimum SOP and POS

• f= (xyz +x`yz+ xy`z+ …..)

Is called sum of products.

The + is sum operator which is an OR gate.

The product such as xy is an AND gate for the two inputs x and y.

Page 54: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Minterm and Maxterm

Page 55: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Example

• Minimize the following Boolean function using sum of products (SOP):

• f(a,b,c,d) = ∑m(3,7,11,12,13,14,15)

abcd 3 00117 011111 101112 110013 110114 111015 1111

a`b`cda`bcdab`cdabc`d`abc`dabcd`abcd

Page 56: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Examplef(a,b,c,d) = ∑m(3,7,11,12,13,14,15) =a`b`cd + a`bcd + ab`cd + abc`d`+ abc`d + abcd` +

abcd =cd(a`b` + a`b + ab`) + ab(c`d` + c`d + cd` + cd )=cd(a`[b` + b] + ab`) + ab(c`[d` + d] + c[d` + d])=cd(a`[1] + ab`) + ab(c`[1] + c[1])=ab+ab`cd + a`cd =ab+cd(ab` + a`)=ab+ cd(a + a`)(a`+b`)= ab + a`cd + b`cd = ab +cd(a` + b`)

Page 57: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Minimum product of sums (MPOS)

• The minimum product of sums (MPOS) of a function, f, is a POS representation of f that contains the fewest number of sum terms and the fewest number of literals of any POS representation of f.

• The zeros are considered exactly the same as ones in the case of sum of product (SOP)

Page 58: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Karnaugh Maps (K-maps)• Karnaugh maps -- A tool for representing Boolean

functions of up to six variables.

• K-maps are tables of rows and columns with entries represent 1`s or 0`s of SOP and POS representations.

Page 59: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Karnaugh Maps (K-maps)• An n-variable K-map has 2n cells with each

cell corresponding to an n-variable truth table value.

• K-map cells are labeled with the corresponding truth-table row.

• K-map cells are arranged such that adjacent cells correspond to truth rows that differ in only one bit position (logical adjacency).

Page 60: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Karnaugh Maps (K-maps)• If mi is a minterm of f, then place a 1 in cell i of the K-

map.

• If Mi is a maxterm of f, then place a 0 in cell i.

• If di is a don’t care of f, then place a d or x in cell i.

Page 61: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Karnaugh MapTruthTable

BooleanFunction

Unique Many different expressions existSimplification from Boolean function

- Finding an equivalent expression that is least expensive to implement- For a simple function, it is possible to obtain

a simple expression for low cost implementation- But, with complex functions, it is a very difficult task

Karnaugh Map (K-map) is a simple procedure forsimplifying Boolean expressions.

TruthTable

Booleanfunction

KarnaughMap

SimplifiedBooleanFunction

Page 62: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Examples• Two variable K-map f(A,B)=∑m(0,1,3)=A`B`+A`B+AB

1 10 1

B 0 1A 0 1

Page 63: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Three variable map

• f(A,B,C) = ∑m(0,3,5)= A`B`C`+A`BC+AB`C

1 1A`BC

1AB`C

A`B`C`

A

B

C

A BC

0

1

00 01 11 10

Page 64: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Karnaugh Map

Page 65: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

• K-map cells that are physically adjacent are also logically adjacent. Also, cells on an edge of a K-map are logically adjacent to cells on the opposite edge of the map.

• If two logically adjacent cells both contain logical 1s, the two cells can be combined to eliminate the variable that has value 1 in one cell’s label and value 0 in the other.

Simplification of Boolean Functions ; Using K-maps

Page 66: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Simplification of Boolean Functions ; Using K-maps

• This is equivalent to the algebraic operation, aP + a′ P =P

where P is a product term not containing a or a′.

• A group of cells can be combined only if all cells in the group have the same value for some set of variables.

Page 67: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Simplification Guidelines for K-maps

• Always combine as many cells in a group as possible. This will result in the fewest number of literals in the term that represents the group.

• Make as few groupings as possible to cover all minterms. This will result in the fewest product terms.

• Always begin with the largest group, which means if you can find eight members group is better than two four groups and one four group is better than pair of two-group.

Page 68: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Simplification Guidelines for K-maps

Page 69: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Example

Page 70: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Example(Fig 1-10 ~ 1-13)

Page 71: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

AND/OR, NAND/NOR logic diagram

Inverted-OR NAND

Page 72: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Different styles of drawing mapsf(A,B,C) = ∑m(1,2,3,6) = A′C + BC′

1

CAB

00 01 11 100 2 6 4

3 7 5

0

1

B

1 1

1 1

A

C

BCA 00 01 11 10

0

1

1 1 1

1

11 11

C

AB0 1

00

01

11

10

Page 73: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

•Minterms that may produce either 0 or 1 for the function.

•They are marked with an ´ in the K-map.

•This happens, for example, when we don’t input certain minterms to the Boolean function.

•These don’t-care conditions can be used to provide further simplification of the algebraic expression.

(Example) F = A`B`C`+A`BC` + ABC`

d=A`B`C +A`BC + AB`C

F = A` + BC`

Don’t-care conditionB

1 1

1

Page 74: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

Five variable K-mapsUse Two Four-variable K-Maps

a`=0 map a=1 map

11

11

11

11

1 1

f(a,b,c,d,e) = ∑m(0,5,7,13,15,16,21,23,29,31)a` f

0 1

1

2

3

4

5 1

6

7 1

8

9

10

11

12

13 1

14

15 1

a f

16 1

17

18

19

20

21 1

22

23 1

24

25

26

27

28

29 1

30

31 1

Page 75: chap01 Digital Logic Circuits - SANGJIdblab.sangji.ac.kr/downloads/csa/chap01.pdf3 Instruction Set Architecture • ISA = attributes of the computing system as seen by the programmer

a`=0 map a=1 map

11

11

11

11

1 1

F1=a`b`c`d`e` + a`ce, F2=ace + ab`c`d`e`f(a,b,c,d,e) = f1+f2

F=(a+a`)ce + (a+a`)b`c`d`e`=ce + b`c`d`e`