nguyen thanh kien department of computer engineering faculty of information technology hanoi...

290
Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Upload: caitlin-jackson

Post on 12-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Nguyen Thanh KienDepartment of Computer EngineeringFaculty of Information TechnologyHanoi University of Technology

Computer Architecture

Page 2: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 2

About

Author: Nguyen Thanh Kien

Office:

Department of Computer Engineering

Faculty of Information Technology

Hanoi University of Technology

Mobile: +84983 588 135

Email: [email protected]

[email protected]

Page 3: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 3

Content

1. Introduction

2. Function Minimization Methods

3. Larger Combinational Systems

4. Sequential Systems

5. Hardware Design Languages

Page 4: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 4

Acknowledge

The following materials are used as reference for this slide:

– “Logic Circuits” slide, Dr. Trinh Van Loan.

– Introduction to Logic Design, 2nd Ed, Alan B. Marcovitz, Mc. Graw Hill,2005

– Foundation of Digital Logic Design, G.Langholz, A. Kandel, J. Mott, World Scientific, 1998

Page 5: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 5

Reference textbooks

Introduction to Logic Design, 2nd Ed,, Alan B, Marcovitz, Mc. Graw Hill,2005

Foundation of Digital Logic Design, G.Langholz, A. Kandel, J. Mott, World Scientific, 1998

Page 6: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 6

Grading policy

Homework: 20%

Lab work: 20%

Midterm: 30%

Final Exam (multichoice and writing): 30%

Page 7: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 7

1. Introduction

1.1. Review of Number Systems

1.2. Switching Algebra and Logic Circuits

Page 8: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 8

Chapter 1. Introduction

Page 9: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 9

1.1. Review of Number Systems

1.1.1 Number Representation

1.1.2 Binary Addition

1.1.3 Signed Numbers

1.1.4 Binary Subtraction

1.1.5 Binary Coded Decimal (BCD)

1.1.6 Other Codes

Page 10: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 10

1.1. Review of Number Systems

1.1.1 Number Representation

1.1.2 Binary Addition

1.1.3 Signed Numbers

1.1.4 Binary Subtraction

1.1.5 Binary Coded Decimal (BCD)

1.1.6 Other Codes

Page 11: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 11

1.1.1. Number Representation

Numbers are normally written using a positional number system:

– Base/radix: b (the number of digits)

– Digits: 0..(b-1)

• 0 ≤ ai ≤ (b-1)

– Binary: b=2, digits:0,1

– Decimal: b=10, digits: 0,1,2,3,4,5,6,7,8,9

– Octal: b=8, digits: 0,1,2,3,4,5,6,7

– Hexadecimal: b=16, digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

mnnnb aaaaaaaaN ....... 210121)(

Page 12: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 12

1.1.1. Number Representation

mnnnb aaaaaaaaN ....... 210121)(

mm

nn

nn babababababaN

............ 11

00

11

11)10(

n

mi

ii baN .)10(

11101.11(2) = 1x24+1x23+1x22+0x21+1x20+1x2-1+1x2-2= 29.75(10)

Page 13: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 13

1.1.1. Number Representation

Decimal:

– b=10

– Digits: 0,1,2,3,4,5,6,7,8,9

– Eg:

539.45(10) = 5x102+3x101+9x100+4x10-1+5x10-2

mnnn aaaaaaaaN ....... 210121)10( ai = 0..9

Page 14: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 14

1.1.1. Number Representation

Binary:

– b=2

– Digits: 0,1

– Eg:

1011.011(2) = 1x23 + 0x22 + 1x21 + 1x20 + 0x2-1 + 1x2-2 + 1x2-3

mnnn aaaaaaaaN ....... 210121)2( ai = 0,1

bit – binary digit

n

mi

iiaN 2.)10(

Page 15: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 15

1.1.1. Number Representation

Binary (cnt’)– n-bit binary number can represent which range?

• an-1...a1a0 from 0 to 2n-1

– MSB – Most Significant Bit

– LSB – Least Significant Bit

0001 = 1 1001 = 9

0010 = 2 1010 = 10

0011 = 3 1011 = 11

0100 = 4 1100 = 12

0101 = 5 1101 = 13

0110 = 6 1110 = 14

0111 = 7 1111 = 15

1000 = 8

Page 16: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 16

1.1.1. Number Representation

Octal:

– b=8

– Digits: 0,1,2,3,4,5,6,7

– Eg:

503.071(8) = 5x82 + 0x81 + 3x80 + 0x8-1 + 7x8-2 + 1x8-3

mnn aaaaaaaN ....... 21011)8(

ai = 0..7

Hexadecimal:

– b=16

– Digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

– Eg:

503.071(16) = 5x162 + 0x161 + 3x160 + 0x16-1 + 7x16-2 + 1x16-3

ai = 0..F

mnn aaaaaaaN ....... 21011)16(

Page 17: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 17

Convert from base b to base 10

Base b to base 10 conversion

Eg:

– 1010.11(2)=?

– 1010.11(8)=?

– A12(16)=?

mnnnb aaaaaaaaN ....... 210121)(

mm

nn

nn babababababaN

............ 11

00

11

11)10(

Page 18: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 18

Convert from base 10 to base b

Base 10 to base b conversion

– For integer part:

• Divide integer part by b until the result is 0

• Write remainders in reverse order to get the converted result.

– For the odd part after “.”

• Multiply by b until the result is 0

Page 19: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 19

Convert from base 10 to base 2

Eg1: 6.625(10) = ?(2)

– The integer part

Eg2: 20.75(10) = ?(2)

6 2

0 3 2

1 1 2

1 0

– The odd part after “.”

• 0.625 x 2 = 1.25

• 0.25 x 2 = 0.5

• 0.5 x 2 = 1.0

6.625(10) = 110.101(2)

Page 20: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 20

Convert from base 2 to base 2n

Group from right to left n-bit groups and replace the equivalent values in base 2n

Eg:

101011(2) = ?(8) 1010.110(2)=12.6(8)

101011(2) = ?(16) 1010.110(2)=A.C(16)

Page 21: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 21

Convert from base 2n to base 2

Each digit in base 2n is replaced by n bit in base 2.

Eg:

37A.B(16)=?(2)

Page 22: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 22

Convert from base i to base j

If both i and j are powers of 2, use base 2 as an intermediate base:

– Eg: base 8 base 2 base 16

– 735.37(8)=?(16)

Else, use base 10 as an intermediate base:

– Eg: base 5 base 10 base 2

Page 23: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 23

1.1. Review of Number Systems

1.1.1 Number Representation

1.1.2 Binary Addition

1.1.3 Signed Numbers

1.1.4 Binary Subtraction

1.1.5 Binary Coded Decimal (BCD)

1.1.6 Other Codes

Page 24: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 24

1.1.2 Binary Addition

Binary long addition similar to decimal long addition.

decimal binarycarry 1100 11110

A 2565 10110

B 6754 11011

sum 9319 110001

Eg: 10101(2) + 11011(2) = ? (2)

Page 25: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 25

1.1.2 Binary Addition

Overflow:

– Occur when the result of addition is out of range of representation (the result can not be stored in the predefined number of bits)

– In 8-bit computer, the result of addition of two binary numbers 10101010 and 11010011 is 9-bit binary number which can not be stored in 8-bit => overflow

Page 26: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 26

1.1.2 Binary Addition

n-bit adder in computer:

Page 27: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 27

1.1. Review of Number Systems

1.1.1 Number Representation

1.1.2 Binary Addition

1.1.3 Signed Numbers

1.1.4 Binary Subtraction

1.1.5 Binary Coded Decimal (BCD)

1.1.6 Other Codes

Page 28: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 28

1.1.3 Signed Numbers

Represent sign and amplitude

Use the most-left-bit to represent sign:

– 0: positive, 1: negative

Eg: represent signed numbers using 4 bit:

– +5 = 0101, -5 = 1101, -3 = 1011

– Using 3 right bits to represent amplitude, we can represent from -7 to +7.

– Drawbacks:

• +0 = 0000, -0 = 1000 => complex when calculating

=> need an other representation

Page 29: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 29

2’s complement representation

Most left bit is still sign bit

Positive and 0 numbers are expressed in usual binary format.

– The largest number can be represented is 2n-1-1

– n=8 => largest signed number: 28-1-1 = 127

Negative number a is stored as the binary equivalent of 2n-a in a n-bit system.

– -3 is stored as 28-3=11111101 in a 8-bit system

– The most negative number can be stored is -2n-1

Page 30: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 30

2’s complement representation

+10 = 0000 1010

- 10 = 28-10 = 1 0000 0000

– 0000 1010

1111 0110

- 10 = 1111 0110

+10 + (-10) = ?

Page 31: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 31

2’s complement representation

Procedure to find binary representation of negative number in 2’s complement:

– Find the binary equivalent of the magnitude

– Complement each bit (0=>1, 1=>0)

– Add 1

Eg: find representation of -13 in 8-bit signed number system using 2’s complement:

• Magnitude: 13 = 0000 1101

• Complement: 1111 0010

• Add 1: 1

• -13 = 1111 0011+

Page 32: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 32

2’s complement representation

Range of representation:

– Use n bit to represent 2’s complement numbers

– Range: -2n-1 => 2n-1-1

Page 33: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 33

4 bit representation of unsigned and signed (2’s complement)

Binary format Unsigned Signed

0000 0 0

0001 1 +1

0010 2 +2

0011 3 +3

0100 4 +4

0101 5 +5

0110 6 +6

0111 7 +7

1000 8 -8

1001 9 -7

1010 10 -6

1011 11 -5

1100 12 -4

1101 13 -3

1110 14 -2

1111 15 -1

Page 34: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 34

2’s complement representation

To find the magnitude of a negative number:

– Complement each bit

– Add 1

Eg:

-5 1011 -1 1111

0100 0000

1 1

5 0101 1 0001

Page 35: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 35

Addition of signed numbers

The reason that 2’s complement is so popular is the simplicity of addition.

To add any two numbers, no matter what the sign of each is, we just do binary addition on their representation.

-5 1011 -5 1011 -5 1011

+7 0111 +5 0101 +3 0011

+2 0010 0 0000 -2 1110

Page 36: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 36

Addition of signed numbers

Overflow

– Occur when?

– Add two numbers of the opposite sign?

– Add two positive numbers?

– Add two negative numbers?

maybe

Overflow occurs when adding two numbers with the same sign and the result is in different sign

Page 37: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 37

1.1. Review of Number Systems

1.1.1 Number Representation

1.1.2 Binary Addition

1.1.3 Signed Numbers

1.1.4 Binary Subtraction

1.1.5 Binary Coded Decimal (BCD)

1.1.6 Other Codes

Page 38: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 38

1.1.4 Binary Subtraction

Find the 2’s complement of the second operand, then add.

a – b = a + (-b)

Eg: 7 – 5 = ?

5 0101 7 0111

1010 -5 +1011

+ 1 2 0010

-5 1011

Page 39: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 39

1.1. Review of Number Systems

1.1.1 Number Representation

1.1.2 Binary Addition

1.1.3 Signed Numbers

1.1.4 Binary Subtraction

1.1.5 Binary Coded Decimal (BCD)

1.1.6 Other Codes

Page 40: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 40

Binary-Coded Decimal - BCD

BCD:

– Use four bits (a nibble) to represent each of the decimal digits 0 through 9.

– Eg:

375 = 0011 0111 0101(BCD)

Decimal Binary BCD

0 0000 0000

1 0001 0001

2 0010 0010

3 0011 0011

4 0100 0100

5 0101 0101

6 0110 0110

7 0111 0111

8 1000 1000

9 1001 1001

10 1010 0001 0000

11 1011 0001 0001

12 1100 0001 0010

13 1101 0001 0011

14 1110 0001 0100

15 1111 0001 0101

Page 41: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 41

1.1. Review of Number Systems

1.1.1 Number Representation

1.1.2 Binary Addition

1.1.3 Signed Numbers

1.1.4 Binary Subtraction

1.1.5 Binary Coded Decimal (BCD)

1.1.6 Other Codes

Page 42: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 42

ASCII

American Standard Code for Information Interchange - ASCII

Use seven bits to represent various characters on the standard keyboard as well as a number of control signal

Page 43: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 43

Page 44: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 44

Problems

1. Convert the following unsigned numbers:

a. 98.625(10)=?(2)

b. 11011.011(2)=?(10)

c. 6A1.1E(16)=?(8)

2. Represent the following signed numbers:

a. -74 in 8-bit signed 2’s complement.

b. -74 in 16-bit signed 2’s complement.

Page 45: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 45

1. Introduction

1.1. Review of Number Systems

1.2. Switching Algebra and Logic Circuits

Page 46: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 46

1.2. Switching Algebra and Logic Circuits

1.2.1 Definition of Switching Algebra

1.2.2 Basic Properties of Switching Algebra

1.2.3 Manipulation of Algebraic Functions

1.2.4 Representations of Algebraic Functions

1.2.5 Implementation of Functions with AND, OR, NOT, NAND, NOR, XOR Gates

Page 47: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 47

1.2. Switching Algebra and Logic Circuits

1.2.1 Definition of Switching Algebra

1.2.2 Basic Properties of Switching Algebra

1.2.3 Manipulation of Algebraic Functions

1.2.3 Representations of Algebraic Functions

1.2.4 Implementation of Functions with AND, OR, NOT, NAND, NOR, XOR Gates

Page 48: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 48

1.2.1 Definition of Switching Algebra

Switching algebra is binary:

– All variables and constant take on 0 or 1.

• Light on/off, switch: up/down, voltage: low/high...

– Quantities which are not naturally binary must be coded into binary format.

– Three operators:

• OR: a+b

• AND: a.b

• NOT: a’

Page 49: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 49

1.2. Switching Algebra and Logic Circuits

1.2.1 Definition of Switching Algebra

1.2.2 Basic Properties of Switching Algebra

1.2.3 Manipulation of Algebraic Functions

1.2.3 Representations of Algebraic Functions

1.2.4 Implementation of Functions with AND, OR, NOT, NAND, NOR, XOR Gates

Page 50: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 50

Basic Properties of Switching Algebra

P1: Commutative:

– a + b = b + a a.b = b.a

P2: Associative:

– a + (b + c) = (a + b) + c a.(b.c) = (a.b).c

P3:

– a + 0 = a a . 1 = a

P4:

– a + 1 = 1 a . 0 = 0

Page 51: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 51

Basic Properties of Switching Algebra

P5:

– a + a’ = 1 a . a’ = 0

P6: no coefficient and no exponent

– a + a = a a . a = a

– n.a=a (a)n=a

P7: complement

– (a’)’ = a

P8: distributive:

– a.(b+c) = a.b + a.c a + b.c = (a+b).(a+c)

Page 52: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 52

P9: adjacency

– ab + ab’ = a (a+b)(a+b’)=a

P10:

– a + a’b = a +b a(a’+b) = ab

P11: De Morgan

– (a + b)’ = a’b’ (ab)’ = a’ + b’

P12: absorption

– a + ab = a a(a+b) = a

Basic Properties of Switching Algebra

Page 53: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 53

Basic Properties of Switching Algebra

P13: redundant

– ab+b’c+ac = ab+b’c

A B

C

Page 54: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 54

Problems

1. Prove the following equalities:

a. xy’+y=x+y

b. xy+xz’+yz=xy+x’z => prove it incorrect

c. x’y’z+yz+xz=z

d. (x+y)[x’(y’+z’)]’+x’y’+x’z’ = 1

Page 55: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 55

1.2. Switching Algebra and Logic Circuits

1.2.1 Definition of Switching Algebra

1.2.2 Basic Properties of Switching Algebra

1.2.3 Manipulation of Algebraic Functions

1.2.4 Representations of Algebraic Functions

1.2.5 Implementation of Functions with AND, OR, NOT, NAND, NOR, XOR Gates

Page 56: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 56

Manipulation of Algebraic Functions

A literal:

– Is the appearance of a variable or its complement

– Eg: x and x’ are two different literals

– Expression ab’+bc’d+a’d+e’ has 8 literals

A product term:

– Is one or more literal connected by AND operators

– Expression ab’+bc’d+a’d+e’has 4 product terms

– Note: A single literal is also a product term

Page 57: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 57

A standard product term - minterm:

– Is a product term which includes every variable of the function, either uncomplemented or complemented.

– Eg: for a function of four variables a,b,c,d:

• the product term a’bc’d is a standard product term

• the product term a’bd’ is not

Manipulation of Algebraic Functions

Page 58: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 58

A sum of product - SOP:

– Is one or more product terms connected by OR operators

– Eg:

• ab’c+abc’+a’c+a’

• d

A canonical sum – sum of standard product term

– Is a sum of products expression where all terms are standard product terms.

– Eg: A function of three variables a,b,c:

• ab’c + abc’ + abc is a canonical sum

• ab’c + abc’ + a is not

Manipulation of Algebraic Functions

Page 59: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 59

A minimum sum of products:

– Is one of those SOP expression for a function that has the fewest number of product terms.

– If there is more than one expression with fewest number of terms, then minimum is defined as one or more of those expressions with the fewest number of literals.

– Eg:

• F1(x,y,z) = x’yz’+x’yz+ xy’z’+xy’z+xyz

• F2(x,y,z) = x’y+xy’+xyz

• F3(x,y,z) = x’y+xy’+xz

• F4(x,y,z) = x’y+xy’+yz

Manipulation of Algebraic Functions

F3,F4 are minimum SOP of F1

Page 60: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 60

A sum term:

– Is one or more literals connected by OR operators

– Eg:

• a + b’ + c’

• b’

A standard sum term - maxterm:

– Is a sum term that includes each variable of the problem, either uncomplemented or complemented

– Eg: For a function of four variables x,y,z,t

• x+y+z’+t’ is a maxterm

• x+y+t’ is not

Manipulation of Algebraic Functions

Page 61: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 61

A product of sum – POS:

– Is one or more sum terms connected by AND

– Eg:

• (w+x’+y’)(w+y+z’)(w+x+z)

• w

A canonical product – product of standard sum terms:

– Is a product of sum term where all sum terms are standard

Manipulation of Algebraic Functions

Page 62: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 62

A minimum POS is defined the same way as SOP:

– fewest number of terms

– the same number of terms => fewest number of literals

Manipulation of Algebraic Functions

Page 63: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 63

Canonical forms

Three-variable minterm and Maxterm

Decimal x y z minterm Maxterm

0 0 0 0 x’y’z’ (m0) x+y+z (M0)

1 0 0 1 x’y’z (m1) x+y+z’ (M1)

2 0 1 0 x'yz’ (m2) x+y’+z (M2)

3 0 1 1 x'yz (m3) x+y’+z’ (M3)

4 1 0 0 xy’z’ (m4) x’+y+z (M4)

5 1 0 1 xy'z (m5) x'+y+z’ (M5)

6 1 1 0 xyz' (m6) x'+y’+z (M6)

7 1 1 1 xyz (m7) x'+y’+z’ (M7)

Page 64: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 64

Canonical forms

Properties of minterm/Maxterm:

– mimj=0 if i≠j

=mi if i=j

– Mi+Mj=1 if i≠j

= Mi if i=j

– mi=Mi’ and Mi=mi’ for every i

Page 65: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 65

Canonical forms

An algebraic expression of a Boolean function can be derived from a given true table in two ways:

– By summing (ORing) those minterm for which the function takes a value 1.

– By multiplying (ANDing) those maxterm for which the function takes a value 0.

Page 66: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 66

Canonical forms

Decimal x2 x1 x0 f

0 0 0 0 0

1 0 0 1 1

2 0 1 0 0

3 0 1 1 0

4 1 0 0 1

5 1 0 1 1

6 1 1 0 1

7 1 1 1 1

f(x2,x1,x0)=m1+m4+m5+m6+m7

=Σ(1,4,5,6,7)

f(x2,x1,x0)=M0M2M3

= Π(0,2,3)

Canonical sum-of-products (SOP)

Canonical product-of-sums (POS)

Page 67: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 67

F(a,b,c)= abc’+a’b’

F(a,b,c)=m0+m1+m6

– ∑(0,1,6)

Decimal a b c f

0 0 0 0 1

1 0 0 1 1

2 0 1 0 0

3 0 1 1 0

4 1 0 0 0

5 1 0 1 0

6 1 1 0 1

7 1 1 1 0

Page 68: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 68

1.2. Switching Algebra and Logic Circuits

1.2.1 Definition of Switching Algebra

1.2.2 Basic Properties of Switching Algebra

1.2.3 Manipulation of Algebraic Functions

1.2.4 Representations of Algebraic Functions

1.2.5 Implementation of Functions with AND, OR, NOT, NAND, NOR, XOR Gates

Page 69: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 69

1.2.3 Representations of Algebraic Functions

Truth table

Venn diagram

Karnaugh map

Page 70: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 70

Truth table

List all the possible binary combinations of the independent variables and display the corresponding binary values of dependant variables.

Page 71: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 71

Truth table

n independent variables and m dependant functions:

2n rows

n+m columns 3 independent variables

2 dependent functions

23 rows

Page 72: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 72

Venn diagram

Venn diagram using ‘space’ to present logic

F(A,B)=A.B

A B

C

F(A,B)=C.not(B)

Page 73: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 73

Venn diagram

A A

A+B A.B

A.B A+B

Page 74: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 74

Karnaugh map

BC

A

00 01 11 10

0 0 1 3 2

1 4 5 7 6

C

AB 0 1

00 0 1

01 2 3

11 6 7

10 4 5

A Karnaugh map is a graphical method for representing the true table of a Boolean function.

K-map may be used for any variables number, but often at most six.

Page 75: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 75

Karnaugh map (K-map)

If variables number is n => 2n cells in K-map.

2n cells are arranged in logical pattern for minimization purpose.

BC

A

00 01 11 10

0 0 1 3 2

1 4 5 7 6

Page 76: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 76

Two-variable K-map

F(A,B)

0 1

2

3

AB 0 1

0

1

0 2

1

3

BA 0 1

0

1

Page 77: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 77

Two-variable K-map

F(A,B) = AB

0 0

0 1

AB 0 1

0

1

Page 78: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 78

Three-variable K-map

F(A,B,C)

BC

A

00 01 11 10

0 0 1 3 2

1 4 5 7 6

C

AB 0 1

00 0 1

01 2 3

11 6 7

10 4 5

Page 79: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 79

Three-variable K-map

F(x,y,z) = xyz + yz’ + x

x y z F

0 0 0 0

0 0 1 0

0 1 0 1

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

yz

x 00 01 11 10

00 0 0 1

11 1 1 1

z

xy 0 1

000 0

011 0

111 1

101 1

Page 80: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 80

Four-variable K-map

CD

AB 00 01 11 10

00 0 1 3 2

01 4 5 7 6

11 12 13 15 14

10 8 9 11 10

F(A,B,C,D)

Page 81: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 81

Four-variable K-map

F(A,B,C,D) = AB + CD’ + BCD

CD

AB 00 01 11 10

000 0 0 1

010 0 1 1

111 1 1 1

100 0 0 1

Page 82: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 82

Five-variable K-map

1 1 1 1 1 1

00 01 11 10ABCD

00011110

1 1 1 1 1 1

00 01 11 10ABCD

00011110

E 0 1

5 variables Karnaugh Map consists of two4 variables Karnaugh Map connected up/down.

Page 83: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 83

Six-variable K-map

1 1 1 1 1 1

00 01 11 10ABCD

00011110

1 1 1 1 1 1

00 01 11 10ABCD

00011110

E 0 1

1 1 1 1 1 1

00 01 11 10ABCD

00011110

1 1 1 1 1 1

00 01 11 10ABCD

00011110

F

0

1

Page 84: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 84

Karnaugh map with don’t care

CD00 01 11 10

00

01

11

10

AB

1 1

1 1

don’tcare ~ input conditions that not occur

Page 85: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 85

1.2. Switching Algebra and Logic Circuits

1.2.1 Definition of Switching Algebra

1.2.2 Basic Properties of Switching Algebra

1.2.3 Manipulation of Algebraic Functions

1.2.3 Representations of Algebraic Functions

1.2.4 Implementation of Functions with AND, OR, NOT, NAND, NOR, XOR Gates

Page 86: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 86

Basic logic gates

AND OR NOT

A B out

0 0 0

0 1 0

1 0 0

1 1 1

A B out

0 0 0

0 1 1

1 0 1

1 1 1

A out

0 1

1 0

Page 87: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 87

Basic logic gates

NAND NOR XOR

A B out

0 0 1

0 1 1

1 0 1

1 1 0

A B out

0 0 1

0 1 0

1 0 0

1 1 0

A B out

0 0 0

0 1 1

1 0 1

1 1 0

Page 88: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 88

Implementation of Functions with AND, OR

Assume all inputs are available in uncomplemented and complemented

F1 = x’yz’+x’yz+xy’z’+xy’z+xyz

F2 = x’y+xy’+xz

Page 89: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 89

Implementation of Functions with AND, OR, NOT

Complemented inputs can be produced using inverters NOT:

X

Y

Z

F

Page 90: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 90

Multilevel circuits

A circuit is called n-level circuit if the maximum number of gates through which one signal must pass from input to output

two-level circuit three-level circuit

Page 91: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 91

Implementation of Functions with NAND

Using equivalent change steps, every expression can be represented using only NAND gates.

NOT

AND

OR

A

B

A.B (A’.B’)’=A+B

A

B

Page 92: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 92

Implementation of Functions with NAND

Represent the following expression using only NAND:

– F(a,b,c) = ab + bc’ + b’

=

bcbabbcbabbcbab ..

Page 93: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 93

Implementation of Functions with NOR

Using equivalent change steps, every expression can be represented using only NOR gates.

U10A

7402N

U11A

7402N

U7A

7402N

U8A

7402NU9A

7402N

A

B

( A' +B' ) ' =A. BA'

B' U3A

7402N

A

( A+A) ' =A'

Page 94: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 94

Implementation of Functions with NOR

Represent the following expression using only NOR:

– F(a,b,c) = ab + bc’ + b’

Page 95: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 95

Chapter 2.

Function Minimization Methods

Page 96: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 96

2. Function Minimization Methods

2.1 Algebraic Method

2.2 The Karnaugh Map Method

2.3 Quine-McCluskey Method

Page 97: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 97

2. Function Minimization Methods

What is minimization?

– Number of operands is minimal and number of literal in each operand is minimal

Why minimization needed?

– Minimize electronic components used to construct the circuit to implement that expression

Page 98: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 98

2. Function Minimization Methods

2.1 Algebraic Method

2.2 The Karnaugh Map Method

2.3 Quine-McCluskey Method

Page 99: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 99

2.1 Algebraic Method

Use algebraic properties to minimize expressions

Drawback:

– Heuristic, depending on experience – no formal method/procedure

– Manually

– Not sure whether the last expression is minimal or not

Page 100: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 100

2.1 Algebraic Method

Eg: Minimize these expressions using algebraic method:

– F0(x,y,z)=xyz+x’yz+xy’z+xyz’

– F1(a,b,c,d)=ab+abc+a’cd+a’c’d+a’bcd’

– F2(A,B,C,D)=

– F3(x,y,z)=(x+y)(x+y+z’)+y’

– F4(a,b,c,d)=(a+b’+c)(a+c’)(a’+b’+c)(a+c+d)))(.()( CADCBABCA

Page 101: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 101

2.2 The Karnaugh Map Method

1. Minimum Sum of Product Expressions Using the Karnaugh Map

2. Don’t Cares

3. Product of Sums

4. Minimum Cost Gate Implementation

5. Five- and Six-Variable Maps

6. Multiple Output Problems

Page 102: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 102

Implicant, Prime Implicant

An implicant of a function is a product term that can be used in a SOP

CD

AB 00 01 11 10

00 1 1

01 1

11 1 1 1 1

10

Implicants of F

Minterm Groups of 2 Groups of 4A’B’C’D’ A’CD ABA’B’CD BCDA’BCD ABC’ABC’D’ ABDABCD’ ABCABC’D ABD’ABCD

Page 103: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 103

Implicant, Prime Implicant

A prime Implicant is an implicant which can not be contained in any other implicants.

CD

AB00 01 11 10

00 1 1 1

01 1 1

11 1 1

10 1 1 1 1

B C

* B D

* B D

A D

A B

C D

Page 104: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 104

Essential Prime Implicant

Essential PI is a PI which contains at least one minterm which is not contained in other PI.

CD

AB00 01 11 10

00 1 1 1

01 1 1

11 1 1

10 1 1 1 1

B C

* B D

* B D

A D

A B

C D

minterm 0 is only contained in PI B’D’minterm 5 is only contained in PI BD=> BD & B’D’ are two Essential PI

Page 105: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 105

2.2.1 Minimum Sum of Product Expressions

Rules to minimize using K-map:

– Rule 1: Fill K-map cells with corresponding values

– Rule 2: Group adjacent cells whose values are 1. Number of cells is 2n.

– Rule 3: Each group will be a part of result. Variables in each group will be excluded: 2n cells => exclude n variables.

Page 106: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 106

2.2.1 Minimum Sum of Product Expressions

Step 2: Group adjacent cells whose values are 1. Number of cells is 2n.

CD

AB

00 01 11 10

00

01 1 1

11 1 1

10 1 1

CD

AB00 01 11 10

00 1 1

01 1 1

11 1 1

10 1 1

Page 107: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 107

2.2.1 Minimum Sum of Product Expressions

Step 3: Each group will be a part of result. Variables in each group will be excluded: 2n cells => exclude n variables.

CD

AB

00 01 11 10

00

01 1 1

11 1 1

10 1 1

21 cells => eliminate 1 variable

22 cells => eliminate 2 variables

F(A,B,C,D) = A’BC’ + AC

Page 108: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 108

2.2.1 Minimum Sum of Product Expressions

Example 1:

Minimize these functions using K-map:

– a. F(A,B,C,D) = R(0,2,5,6,9,11,13,14)

– b. F(A,B,C,D) = R(1,3,5,8,9,13,14,15)

– c. F(A,B,C,D) = R(2,4,5,6,7,9,12,13)

– d. F(A,B,C,D)= R(1,3,4,5,7,9,13,14,15)

Page 109: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 109

– a. F(A,B,C,D) = R(0,2,5,6,9,11,13,14)

= BC’D + AB’D + BCD’ + A’B’D’

CD

AB

00 01 11 10

00 1 1

01 1 1

111

1

10 1 1

Page 110: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 110

– b. F(A,B,C,D) = R(1,3,4,6,9,11,12,14)

= B’D + BD’

CD

AB

00 01 11 10

001 1

01 11

111

1

10 1 1

Page 111: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 111

2.2 The Karnaugh Map

1. Minimum Sum of Product Expressions Using the Karnaugh Map

2. Don’t Cares

3. Product of Sums

4. Minimum Cost Gate Implementation

5. Five- and Six-Variable Maps

6. Multiple Output Problems

Page 112: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 112

2.2.2 Don’t care

If the function has don’t care values in cells:

– Cells with don’t care values

can be grouped with ‘1’ cells

– Do not group only don’t

care cells in one group.

CD00 01 11 10

00

01

11

10

AB

1 1

1 1

CBCBDCBAF ),,,(

Page 113: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 113

Examples:

F(a,b,c,d)=R(1,3,5,7,12,13)don’t care (0,4,10,15)

CD

AB

00 01 11 10

00 - 1 1

01 - 1 1

11 1 1 -

10 -

Page 114: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 114

2. Function Minimization Methods

2.1 Algebraic Method

2.2 The Karnaugh Map Method

2.3 Quine-McCluskey Method

Page 115: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 115

2.3 Quine-McCluskey Method

1. Quine-McCluskey Method for One Output

2. Iterated Consensus for One Output

3. Prime Implicant Tables for One Output

4. Quine-McCluskey for Multiple Output Problems

5. Iterated Consensus for Multiple Output Problems

6. Prime Implicant Tables for Multiple Output Problems

Page 116: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 116

2.3. Quine-Mcluskey method

Karnaugh map cannot handle more than 6 variables. Quine-McCluskey method has no limitation with number ofvariables, and is suitable for computer algorithm.

0 100 01 111 1 110 1 1

ABC

ABC+ABC+ABC+ABC+ABC

010

*10 11* 1*0 1*1 10*

110 111 100 101

1**

find a pair of numbers of 1 bit difference

Page 117: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 117

Quine-Mcluskey Procedure

1: Represent minterms in binary numbers

2: Group each minterm by the number of ‘1’ appearance

3: Make set of 1 bit different numbers between neighboring group

• write the difference within parenthesis

• mark * to the number which is not included in a set

4: Make set of 1 bit different sets with the same number in a parenthesis

• append the difference to parenthesis

• mark + to the set which is not included in a set

5: Iterate these step until all the generated set is marked *

6: Select prime implicants

7: Convert to logic variable

Page 118: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 118

S1. Represent minterms in binary numbers

f = ABCDEF+ABCDEF+ABCDEF+ABCDEF+ABCDEF +ABCDEF+ABCDEF +ABCDEF+ABCDEF+ABCDEF

f = 000000+000010+000110+000111+001110 +001000+101001+001100+001111+001010

f(A,B,C,D,E,F)=Σ(0,2,6,7,14,8,41,12,15,10)

Page 119: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 119

S2. Grouping

f = 000000+000010+000110+000111+001110 +001000+101001+001100+001111+001010

000000

once twice three times

000010001000

000110001100001010

000111001110101001

four times

001111

group 0 group 1 group 2 group 3 group 4

group each term by the appearance of 1

no times

Page 120: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 120

S3 & S4. Making set (1)

000000 0 000010 2001000 8

000110 6001010 10001100 12

000111 7001110 14101001 41

001111 15

0,2 (2)0,8 (8)

2,6(4)2,10(8)8,10(2)8,12(4)

6,7(1)6,14(8)10,14(4)12,14(2)

7,15(8)14,15(1)

find a pair of 1 bit differencebetween neighboring groupwrite difference within ( )

mark to the number not included in any set

group 0

group 1

group 2

group 3

group 4

Page 121: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 121

S3 & S4. Making set (2)

0,2 (2)0,8 (8)

2,6(4)2,10(8)8,10(2)8,12(4)

6,7(1)6,14(8)10,14(4)12,14(2)

7,15(8)14,15(1)

0,2,8,10(2,8)

2,6,10,14(4,8)8,10,12,14(2,4)

6,7,14,15(1,8)

mark to the setnot involvedin the next level set

when all the set is markedfinish

Each pair appears in duplicate

find a pair of 1 bit different setswith the same value in ( )between neighboring groupappend difference within ( )

Page 122: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 122

S6. Selecting Prime Implicants (1)

410,2,8,10(2,8)2,6,10,14(4,8)8,10,12,14(2,4)6,7,14,15(1,8)

0 2 6 7 8 10 12 14 15 41

x x x xx

x x x xx x x x

x x x x

If only one x in a column, then the row is inevitable implicant

minterms (given at first)

Prim

e implicant(

 

marke

d)

write x into the position where minterm is includedin the prime implicant

inevitableimplicant

Page 123: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 123

S6. Selecting Prime Implicants (2)

410,2,8,10(2,8)2,6,10,14(4,8)8,10,12,14(2,4)6,7,14,15(1,8)

0 2 6 7 8 10 12 14 15 41

x x x xx

x x x xx x x x

x x x x

mini term

prime

implicants

mark minterms involved in theinevitable implicants inevitable

implicants

Page 124: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 124

S7. Conversion to logic variables

41 101001

0,2,8,10(2,8)

000000000010001000001010

8,10,12,14(2,4)001000001010001100001110

6,7,14,15(1,8)000110000111001110001111

ABCDEF

ABDF

ABCF

ABDE

F=ABCDEF +ABDF +ABCF +ABDE

Page 125: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 125

Examples:

Minimize the following functions using Quine-Mcluskey method:

– a.

– b. F(a,b,c,d,e,f) =

∑(17,21,25,29, 44,45,46,47,49,52,53,54,55,47,61)

fedbafdcbfebcaefdba f)e,d,c,b,F(a,

Page 126: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 126

Quine-Mcluskey method with don’t care

1: Represent logic function in sum of mini terms ==>A

2: Represent don’t care in sum of mini terms ==>B

3: If there exist duplication in A and B, remove from A

4: Apply Quine-McCluskey method for A and B

5: Be careful not to include B in selecting prime implicants

Page 127: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 127

Quine-Mcluskey method with don’t care

f=ABCD+BCD+ACD+ABCD+ABCDdon’t care AD

mini termABCD

000000010010001101010111101111011111

decimal

0 1 2 3 5 7111315

first comparison second comparison0,1(1)0,2(2)1,3(2)1,5(4)2,3(1)3,7(4)3,11(8)5,7(2)5,13(8)7,15(8)11,15(4)13,15(2)

0,1,2,3(1,2)

1,3,5,7(2,4)

3,7,11,15(4,8)5,7,13,15(2,8)

Page 128: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 128

Quine-Mcluskey method with don’t care

0 2 11 13 150,1,2,3(1,2)

1,3,5,7(2,4)3,7,11,15(4,8)5,7,13,15(2,8)

xx

xxx

x

00**0**1

**11*1*1

ABCD

f=AB+CD+BD

Page 129: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 129

Chapter 3.

Larger Combinational Systems

Page 130: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 130

Introduction

Logic circuits are divided into two classes:

– Combinational logic circuits

• Output signals only depend on current input signals

• Memoryless circuits

– Sequential logic circuits

• Output signals not only depend on current input signals, but also depend on those input signals in the past

• Memory circuits

Page 131: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 131

3. Larger Combinational Systems

3.1 Delay in Combinational Logic Circuits

3.2 Adders and Other Arithmetic Circuits

3.3 Decoders

3.4 Encoders

3.5 Multiplexers

3.6 Demultiplexers

3.7 Three-State Gates

3.8 Gate Arrays-ROMs, PLAs and PALs

3.9 Larger Examples

Page 132: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 132

3.1 Delay in Combinational Logic Circuits

Delay through logic gates

– When the input to a gate changes, the output of that gate doesn’t change immediately; but there is a small delay Δ.

– The output is stable after the longest delay path

A

B

CF

X

Page 133: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 133

3. Larger Combinational Systems

3.1 Delay in Combinational Logic Circuits

3.2 Adders and Other Arithmetic Circuits

3.3 Decoders

3.4 Encoders

3.5 Multiplexers

3.6 Demultiplexers

3.7 Three-State Gates

3.8 Gate Arrays-ROMs, PLAs and PALs

3.9 Larger Examples

Page 134: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 134

Half Adder

a b r

0 0 0 0

0 1 1 0

1 0 1 0

1 1 0 1

=a b

r = ab

=1

&

a

b

r

Half Adder

HAa

b

r

(Result)

(Carry-out)

Page 135: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 135

Addition of two n-bit numbers

4 3 2 1 0

r3 r2 r1 r0

A = a3 a2 a1 a0

+B = b3 b2 b1 b0

r4 3 r3 2 r2 1 r1 0

Summation

Page 136: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 136

Full Adder

FAai

ri

bi

i

ri+1

ai bi ri iri+1

0 0 0 0 0

0 0 1 1 0

0 1 0 1 0

0 1 1 0 1

1 0 0 1 0

1 0 1 0 1

1 1 0 0 1

1 1 1 1 1

aibi

ri00 01 11 10

01 1

11 1

i

aibi

ri00 01 11 10

01

11 1 1

ri+1

i = ai bi ri

ri+1 = ai bi + ri (ai bi)

Page 137: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 137

Combinational logic circuit design procedure

Problems: design a combinational logic circuit to do smth.

Design procedure:

– S1: Find inputs, outputs.

– S2: Construct truth table

– S3: For each output, using K-map to minimize from truth table.

– S4: Draw the circuit.

Page 138: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 138

Example 1

Problem: Design a combinational logic circuit to implement this operation: M=N+3, N is 3-bit binary number, the number of bit of M is selected properly.

Solution:

– S1: three inputs: n2n1n0

four outputs: m3m2m1m0

Page 139: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 139

Example 1

S1: three inputs: n2n1n0

four outputs: m3m2m1m0

S2: truth table

n2 n1 n0 m3 m2 m1 m0

0 0 0 0 0 1 1

0 0 1 0 1 0 0

0 1 0 0 1 0 1

0 1 1 0 1 1 0

1 0 0 0 1 1 1

1 0 1 1 0 0 0

1 1 0 1 0 0 1

1 1 1 1 0 1 0

S3:

n1n0

n2

00 01 11 10

0 0 0 0 0

1 0 1 1 1

m3 = n2n0 + n2n1

n2n1n0

m3m2m1m0

Page 140: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 140

Example 2

Problem: design a combinational logic circuit to calculate square of a 2-bit binary number.

Solution:

– Step1: find inputs, outputs

• Inputs: a1,a0

• Outputs: b3,b2,b1,b0

Ex2

Page 141: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 141

– Step 2: truth table

– Step3: using K-map to minimize outputs

• b3 = a1.a0 b1 = 0

• b2 = a1.a0’ b0 = a0

Example 2

a1 a0 b3 b2 b1 b0

0 0 0 0 0 0

0 1 0 0 0 1

1 0 0 1 0 0

1 1 1 0 0 1

Page 142: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 142

Example 2

– Step 4: Draw circuit

• b3 = a1.a0 b1 = 0

• b2 = a1.a0’ b0 = a0

a1

a0

b3

b2

b1

b0

U1A

7408N

U1B

7408N

U2A

7404N

X1

2.5 V X2

2.5 V X3

2.5 V X4

2.5 V

R1100

V15 V

J1

Key = A

R2100

V212 V

J2

Key = B

Page 143: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 143

Full Adder

=1

&

ri

ai

bi

=1

&

i

ri+1

1

Page 144: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 144

Full Adder

=1

&

ri

ai

bi

=1

&

i

ri+1

1

HA HA

Page 145: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 145

n-bit Adder

Serial n-bit adder

A = an-1an-2...a1a0 , B = bn-1bn-2...b1b0

FA

an-1 bn-1

rn-1

rn

n-1

FA

an-2 bn-2

rn-2

n-2

FA

a1 b1

r1

r2

1

FA

a0 b0

r0= 0

0n

Delay = n x Δ?

Page 146: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 146

n-bit Adder

Parallel n-bit adder:

ri+1 = aibi + ri(ai bi)

Pi = ai bi and Gi = aibi ri+1 = Gi + ri Pi

r1 = G0 + r0P0

&

1G0

P0

r0

r1

1 2

r2 = G1 + G0P1 + r0P0P1

&

1G1

G0

P1

r2

12

&P0

r0

Page 147: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 147

Parallel 4-bit addition

r4 = 4 3 2 1 0

r2 r1 a2 b2 a1 b1

a0 b0

P3 G3 P2 G2 P1 G1 P0 G0

Calculate Pi and Gi

a3 b3 a2 b2 a1 b1 a0 b0

Carry calculation

Sum calculation

r0 a3 b3

r3 r4

r0

Page 148: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 148

Subtractor

To subtract a-b, simply add a to 2’s complement of b.

Second choice:

Half Subtractor => Full Subtractor => n-bit Subtractor

Page 149: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 149

Subtractor

Subtractor by using 2’s complement

A3 A2 A1 A0

B3 B2 B1 B0

S3 S2 S1 S0

1C1C2C3

C4A B

C

S

C+ FAA B

C

S

C+ FAA B

C

S

C+ FAA B

C

S

C+ FA

Page 150: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 150

Adder and Subtractor

C1C2C3C4

A B

C

S

C+ FAA B

C

S

C+ FAA B

C

S

C+ FAA B

C

S

C+ FA

MPX MPX MPX MPX

A3 A2 A1 A0B3 B2 B1 B0

S3 S2 S1 S0

sel

Page 151: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 151

3. Larger Combinational Systems

3.1 Delay in Combinational Logic Circuits

3.2 Adders and Other Arithmetic Circuits

3.3 Decoders

3.4 Encoders

3.5 Multiplexers

3.6 Demultiplexers

3.7 Three-State Gates

3.8 Gate Arrays-ROMs, PLAs and PALs

3.9 Larger Examples

Page 152: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 152

Decoder

An nxm decoder is a combinational circuit that converts binary information from n input lines to m output lines, where m≤2n.

– m = 2n => complete decoder

Fundamental property: only one output is 1 for any given input combination.

Page 153: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 153

Decoder

Complete decoders: m=2n

Eg: + 3 bit inputs x1,x2,x3. + 8 bit outputs Y0,Y1…Y7

nxm decoder

.

.

.

.

.

.

x1

x2

xn

D0

D1

Dm-1

E

3x8 decoder ...

x1

x2

x3

D0

D1

D7

Page 154: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 154

Design 3x8 decoder

3x8 decoder ...

x1

x2

x3

D0

D1

D7

En

if (En=0)Disable or D0...D7=0

else if (En=1)Function as a 3x8 decoder

Page 155: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 155

BCD-to-decimal decoder

BCDto

decimalDecoder

ABCD

Y0

Y1

Yi

Y9

:

:

N A B C D Y0 Y1 ..

Y9

0 0 0 0 0 1 0 ..

0

1 0 0 0 1 0 1 ..

0

2 0 0 1 0 0 0 ..

0

3 0 0 1 1 0 0 ..

0

4 0 1 0 0 0 0 ..

0

5 0 1 0 1 0 0 ..

0

6 0 1 1 0 0 0 ..

0

7 0 1 1 1 0 0 ..

0

8 1 0 0 0 0 0 ..

0

9 1 0 0 1 0 0 . 1

Page 156: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 156

BCD-to-decimal decoder

0 1Y A B C D Y A B C D

2Y BCD

3

4

5

6

7

8

9

Y BCD

Y BC D

Y BC D

Y BC D

Y BCD

Y AD

Y AD

CD

AB00 01 11 10

00 1

01

11

10

Page 157: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 157

Decoder

4x16 decoder using two 3x8 decoders

3x8 decoder ...

x2

x3

x4

D0

D1

D7

3x8 decoder ...

x1

D8

D9

D15

Page 158: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 158

Decoder implementation of arbitrary functions

4x16 decoder

x2

x3

x4

D0

D1

D2

x1

D3

D4

D5

D6D7

D8

D9D10

D11

D12

D13D14

D15

F1

F1(x1,x2,x3,x4)=Σ(0,1,3,8,12)

Page 159: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 159

BCD-to-7segment decoder

a

b

c

d

e

f g

Each segment is a LightEmitting Diode (LED)

KA

N A B C D a b c d e f g

0 0 0 0 0 1 1 1 1 1 1 0

1 0 0 0 1 0 1 1 0 0 0 0

2 0 0 1 0 1 1 0 1 1 0 1

3 0 0 1 1 1 1 1 1 0 0 1

4 0 1 0 0 0 1 1 0 0 1 1

5 0 1 0 1 1 0 1 1 0 1 1

6 0 1 1 0 1 0 1 1 1 1 1

7 0 1 1 1 1 1 1 0 0 0 0

8 1 0 0 0 1 1 1 1 1 1 1

9 1 0 0 1 1 1 1 1 0 1 1

Page 160: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 160

BCD-to-7segment decoder

CD

AB 00 01 11 10

00 1 0 1 1

01 0 1 1 1

11

10 1 1

a A C BD B D

&

&

B

D

A

C

Page 161: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 161

3. Larger Combinational Systems

3.1 Delay in Combinational Logic Circuits

3.2 Adders and Other Arithmetic Circuits

3.3 Decoders

3.4 Encoders

3.5 Multiplexers

3.6 Demultiplexers

3.7 Three-State Gates

3.8 Gate Arrays-ROMs, PLAs and PALs

3.9 Larger Examples

Page 162: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 162

Encoder

An encoder is a circuit that performs the function of a decoder in reverse.

An mxn encoder has m inputs, n outputs where m≤2n. The outputs generate the binary codes corresponding to m inputs.

For example: encoder for PC’s keyboard

Key <=> Character <=> Key code

102 keys, 8 bit ASCII

Page 163: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 163

Keyboard encoder

9 keys

4-bit key code.

1

2

i Encoder

9

P2

P1

Pi

A

B

C

D

N=i

‘1’

P9

Page 164: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 164

Keyboard encoder

A = 1 if (N=8) or (N=9)B = 1 if (N=4) or (N=5) or (N=6)

or (N=7)C = 1 if (N=2) or (N=3) or (N=6)

or (N=7)D = 1 if (N=1) or (N=3) or (N=5) or (N=7) or (N=9)

N ABCD

1 0001

2 0010

3 0011

4 0100

5 0101

6 0110

7 0111

8 1000

9 1001

Page 165: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 165

Keyboard encoder

1

1

1

1

N=9

N=8

N=7

N=6

N=5

N=4

N=3

N=2

N=1

A

B

C

D

Page 166: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 166

3. Larger Combinational Systems

3.1 Delay in Combinational Logic Circuits

3.2 Adders and Other Arithmetic Circuits

3.3 Decoders

3.4 Encoders

3.5 Multiplexors

3.6 Demultiplexors

3.7 Three-State Gates

3.8 Gate Arrays-ROMs, PLAs and PALs

3.9 Larger Examples

Page 167: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 167

Multiplexor

Multiplexor has one output and more than one input.

Function: select one of input for output

X0

X1

C0

Y

MUX 2-1

C0 Y

0 X0

1 X1

C1 C0 Y

0 0 X0

0 1 X1

1 0 X2

1 1 X3

control inputs

X0

X1

X2

X3

C0

C1

Y

MUX 4-1

Page 168: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 168

2-to-1 Multiplexor

X0

X1

C0

Y

MUX 2-1

C0 Y

0 X0

1 X1

0 0 1 0Y X C X C

X1X0

C0

00 01 11 10

0 1 1

1 1 1

C0 X1 X0 Y

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 1

Page 169: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 169

2-to-1 Multiplexor

Page 170: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 170

4-to-1 Multiplexor

Y = s1’s0’I0 + s1’s0I1 +s1s0’I2+ s1s0I3

Page 171: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 171

Application of multiplexor

Select source

Source 1 Source 2

Receiver

Y3 Y2 Y1 Y0

A = a3 a2 a1 a0 B = b3 b2 b1 b0

C0

Page 172: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 172

Application of multiplexor

Convert parallel-serial

a0

a1

a2

a3

C0

C1

Y

a0 a1 a2 a3

Y

C1

C0

0

1

0

1

t

t

t

A

Page 173: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 173

Application of multiplexor

Implementation of arbitrary functions:

f(A,B) A Bf(0,0) A Bf(0,1) A Bf(1,0) A Bf(1,1)

1 0 0 1 0 1 1 0 2 1 0 3Y C C X C C X C C X C C X

x0

x1

x2

x3

C1 C0

f(0,0)

f(0,1)

f(1,0)

f(1,1)

A

B

Y = f(A,B)Inputs to select function

Variables

Page 174: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 174

Example

F(A,B) = A’B + AB’

x0

x1

x2

x3

C1 C0

0

1

1

0

A

B

Y = f(A,B)Inputs to select function

Variables

Page 175: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 175

3. Larger Combinational Systems

3.1 Delay in Combinational Logic Circuits

3.2 Adders and Other Arithmetic Circuits

3.3 Decoders

3.4 Encoders and Priority Encoders

3.5 Multiplexers

3.6 Demultiplexers

3.7 Three-State Gates

3.8 Gate Arrays-ROMs, PLAs and PALs

3.9 Larger Examples

Page 176: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 176

Demultiplexor

Demultiplexor has one input and more than one output

Function: select one of outputs for input

E

C0

S0

S1

ECS

ECS

01

00

DeMUX 1-2

Page 177: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 177

Demultiplexor 1-4

E

C1

C0

S0

S1

S2

S3

Page 178: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 178

3. Larger Combinational Systems

3.1 Delay in Combinational Logic Circuits

3.2 Adders and Other Arithmetic Circuits

3.3 Decoders

3.4 Encoders and Priority Encoders

3.5 Multiplexers

3.6 Demultiplexers

3.7 Three-State Gates

3.8 Gate Arrays-ROMs, PLAs and PALs

3.9 Larger Examples

Page 179: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 179

3.7 Three-State Gates (Tristate)

Three state gates exhibit three states instead of two states. The three states are:

– High : 1

– Low : 0

– High impedance : z

• In this state the output is disconnected which is equal to open circuit. In the other words in that state circuit has no logic significant. We can have AND or NAND three-state gates but the most common is three-state buffer gate

Page 180: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 180

3.7 Three-State Gates (Tristate)

We may use conventional gates such as AND or NAND as three-state gates but the most common is three-state buffer gate.

Note that buffer produces transfer function and can be used for power amplification. Three state buffer has extra input control line entering the bottom of the gate symbol (see next slide)

Page 181: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 181

Three-State buffer

Three-state buffer

C A Y----------------------0 0 z0 1 z1 0 01 1 1

Page 182: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 182

Application of three-state buffer

Three-state buffers can be used to implement

multiplexer

Page 183: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 183

3. Larger Combinational Systems

3.1 Delay in Combinational Logic Circuits

3.2 Adders and Other Arithmetic Circuits

3.3 Decoders

3.4 Encoders and Priority Encoders

3.5 Multiplexers

3.6 Demultiplexers

3.7 Three-State Gates

3.8 Gate Arrays - ROMs, PLAs and PALs

3.9 Larger Examples

Page 184: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 184

3.8 Gate Arrays - ROM, PLA and PAL

Page 185: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 185

PLA - Programmable logic arrays

Pre-fabricated building block of many AND/OR gates

– actually NOR or NAND

– "personalized" by making or breaking connections among the gates

– programmable array block diagram for sum of products form

• • •

inputs

ANDarray

• • •

outputs

ORarrayproduct

terms

A B C Z1 Z2m0 0 0 0 0 1m1 0 0 1 0 0m2 0 1 0 1 1m3 0 1 1 0 0m4 1 0 0 0 1m5 1 0 1 1 0m6 1 1 0 1 1m7 1 1 1 1 0

Page 186: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 186

Before programming

All possible connections are available before "programming"

– in reality, all AND and OR gates are NANDs

Page 187: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 187

After programming

Unwanted connections are "blown"

– fuse (normally connected, break unwanted ones)

– anti-fuse (normally disconnected, make wanted connections)

A B C

F1 F2 F3F0

AB

B'C

AC'

B'C'

A

Page 188: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 188

PLA example

Multiple functions of A, B, C

– F1 = A B C

– F2 = A + B + C

– F3 = A' B' C'

– F4 = A' + B' + C'

– F5 = A xor B xor C

– F6 = A xnor B xnor C

A B C F1F2 F3F4 F5F60 0 0 0 0 1 1 0 00 0 1 0 1 0 1 1 10 1 0 0 1 0 1 1 10 1 1 0 1 0 1 0 01 0 0 0 1 0 1 1 11 0 1 0 1 0 1 0 01 1 0 0 1 0 1 0 01 1 1 1 1 0 0 1 1

A'B'C'

A'B'C

A'BC'

A'BC

AB'C'

AB'C

ABC'

ABC

A B C

F1 F2 F3 F4 F5F6

full decoder as for memory address

bits stored in memory

Page 189: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 189

PALs and PLAs

Programmable logic array (PLA)

– what we've seen so far

– unconstrained fully-general AND and OR arrays

Programmable array logic (PAL)

– constrained topology of the OR array

– innovation by Monolithic Memories

– faster and smaller OR plane

a given column of the OR array has access to only a subset of

the possible product terms

Page 190: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 190

ROM – Read Only Memories

Two dimensional array of 1s and 0s

– entry (row) is called a "word"

– width of row = word-size

– index is called an "address"

– address is input

– selected word is output

decoder

0 n-1

Address

2 -1n

0

1 1 1 1

word[i] = 0011

word[j] = 1010

bit lines (normally pulled to 1 through resistor – selectively connected to 0 by word line controlled switches)

j

i

internal organization

word lines (only one is active – decoder is just right for this)

Example:10 address x 8 data ROM210 words x 8 ROM 1024 words x 8 ROM1k x 8 ROM

Page 191: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 191

ROM – Read Only Memories

F0 = A' B' C + A B' C' + A B' C

F1 = A' B' C + A' B C' + A B C

F2 = A' B' C' + A' B' C + A B' C'

F3 = A' B C + A B' C' + A B C'

truth table

A B C F0 F1 F2 F30 0 0 0 0 1 00 0 1 1 1 1 00 1 0 0 1 0 00 1 1 0 0 0 11 0 0 1 0 1 11 0 1 1 0 0 01 1 0 0 0 0 11 1 1 0 1 0 0

block diagram

ROM8 words x 4 bits/word

address outputsA B C F0 F1 F2 F3

Combinational logic implementation (two-level canonical form) using a ROM

Page 192: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 192

ROM structure

Similar to a PLA structure but with a fully decoded AND array

– completely flexible OR array (unlike PAL)

n address lines

• • •

inputs

decoder 2n wordlines

• • •

outputs

memoryarray

(2n wordsby m bits)

m data lines

Page 193: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 193

3. Larger Combinational Systems

3.1 Delay in Combinational Logic Circuits

3.2 Adders and Other Arithmetic Circuits

3.3 Decoders

3.4 Encoders and Priority Encoders

3.5 Multiplexers

3.6 Demultiplexers

3.7 Three-State Gates

3.8 Gate Arrays-ROMs, PLAs and PALs

3.9 Larger Examples

Page 194: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 194

3.9 Larger Examples

1. Seven-segment displays

2. Comparator

Page 195: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 195

Comparator

1-bit full comparator:

1bit Full

Comparator

ai

bi

Gi

Li

Ei

iii

iii

iii

baE

baL

baG

.

.ai > bi Gi=1ai < bi Li=1ai = bi Ei=1

Page 196: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 196

Comparator

N-bit parallel comparator:

Page 197: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 197

Midterm examination (90’)

1. Represent the following function in the canonical form SOP:

F(A,B,C)=(A+B’)C

2. Use the Quine-McCluskey method to obtain the minimal sum for the following function:

F(A,B,C,D,E)= ∑(1,4,6,7,8,9,10,11,15)

3. Design 4x16 decoder using only 2x4 decoders.

4. Design a combinational logic circuit to calculate the following function: M=N+3 where N is BCD number (Binary-Coded Decimal).

Page 198: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 198

Midterm examination 2 (90’)

1. Represent the following function in the canonical form SOP and POS:

F(A,B,C)=C

2. Use the Quine-McCluskey method to obtain the minimal sum for the following function:

F(A,B,C,D,E)= ∑(1,4,6,7,8,11,12,13,15)

3. Using 3x8 decoder to implement the following function:

F(A,B,C) = AB + B’C

4. Design a combinational logic circuit to calculate the following function: M=N+5 where N is BCD number (Binary-Coded Decimal).

Page 199: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 199

Chapter 4.

Sequential Systems

Page 200: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 200

4. Sequential Systems

4.1 Definitions

4.2 State Tables and Diagrams

4.3 Latches and Flip Flops

4.4 Analysis of Sequential Systems

4.5 Design of Sequential Systems

4.6 Solving Larger Sequential Problems

Page 201: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 201

4.1 Definitions

Combinatorial circuit is memoryless.

In a circuit with memory, an output value at tn+1 must be a function not only of the inputs at tn+1 but also of the outputs at tn.

To achieve this, the circuit must have some feedback connections from its outputs to its inputs.

A circuit with memory is a combinatorial circuit incorporating some feedback connections.

Page 202: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 202

Feedback and memory devices

To implement feedback, signals are fed back from outputs to inputs using memory devices.

A memory device stores an output value at time tn so that it can be input to the circuit at tn+1.

But then, output at tn depends on input at tn-1, which in turn depends on tn-2…

The circuit maps input sequences to output sequences

Page 203: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 203

Sequential circuit model

Circuits with memory are called sequential circuits.

Combinatorial circuit

.

..

x1

x2

xn

.

..

z1

z2

Memorydevice

Memorydevice

..

.

Yk

Y1

yk

y1

Circuit inputs Circuit outputs

Present state Next state

Page 204: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 204

Sequential circuit model

Mealy model:

• X : finite inputs. m inputs: x1,x2...,xm

• S : finite states. n states: s1,s2...,sn

• Y: finite outputs. l outputs: y1,y2...,yl

• Fs: state function. Fs = Fs(X,S)

• Fy : output function. Fy = Fy(X,S)

Moore: ~Mealy

• Difference: Fy = Fy(S)

Page 205: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 205

Asynchronous/Synchronous sequential circuits

The timing of the signal in the circuit determine two types of sequential circuits:

– Synchronous

– Asynchronous.

Page 206: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 206

Synchronous sequential circuits

In a synchronous sequential circuit, the state can change only at discrete instants of time.

To achieve that, the circuit uses a timing device, called a clock generator, that produce trains of periodic or aperiodic clock pulses.

The clock pulses are input to the memory devices so that they can change state only in response to the arrival of a pulse and only once for each pulse occurrence.

The operation of the circuit is synchronized with the clock pulse input.

Page 207: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 207

Asynchronous sequential circuits

The behavior of an asynchronous sequential circuit depends only on the order in which the inputs change and can be affected at any instant of time.

There is no timing device in asynchronous sequential circuit (unclocked memory).

Page 208: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 208

4. Sequential Systems

4.1 Definitions

4.2 State Tables and Diagrams

4.3 Latches and Flip Flops

4.4 Analysis of Sequential Systems

4.5 Design of Sequential Systems

4.6 Solving Larger Sequential Problems

Page 209: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 209

State diagram

Depict graphically the operation of a sequential circuit.

– Mealy state diagram

a b c d0/0 1/0 0/0

0/00/0

1/0 1/1

Page 210: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 210

Example of state diagram

A B C D0 /0

1 /0 0 /0

1 /0

1 /0

0 /0

0 /0

1 /1

Example: a sequential circuit is used to detect the string “0101” from one input.

Page 211: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 211

State diagram

Depict graphically the operation of a sequential circuit.

– Moore state diagram

a/0

b/0

c/0

d/0

e/1

f/1

01 0

0

0

0

0

1

1

1

1

1

Page 212: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 212

State table

State table presents in a tabular form the same information contained in the state diagram.

– Mealy state table

– Moore state table

Page 213: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 213

Mealy state table

PS NS Output (z)

x=0 x=1 x=0 x=1

a b a 0 0

b b c 0 0

c d a 0 0

d b c 0 1

PS NS/Output (z)

x=0 x=1

a b/0 a/0

b b/0 c/0

c d/0 a/0

d b/0 c/1

PS: Present StateNS: Next State

k memory devices => 2k rowsn circuit inputs => NS portion contains 2n columns Output portion also contains 2n columns

a b c d0/0 1/0 0/0

0/00/0

1/0 1/1

Page 214: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 214

Moore state table

PS NS Output

x=0 x=1 z

a b a 0

b b c 0

c d c 0

d d e 0

e f e 1

f f a 1

The output portion always contains a single column.

The entry at the intersection of any row with the output column indicates the output values corresponding to the PS associated with that row.

a/0

b/0

c/0

d/0

e/1

f/1

01 0

0

0

0

0

1

1

1

1

1

Page 215: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 215

Incompletely specified Mealy state table

Two inputs: x1,x2

A single output: z

PS NS/Output (z)

00 01 11 10

a -/- c/1 b/- e/1

b e/0 -/- -/- -/-

c f/0 f/1 -/- -/-

d a/- -/- e/- b/1

e -/- f/0 d/1 a/0

f c/0 -/- c/1 b/0

Page 216: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 216

4. Sequential Systems

4.1 Definitions

4.2 State Tables and Diagrams

4.3 Latches and Flip Flops

4.4 Analysis of Sequential Systems

4.5 Design of Sequential Systems

4.6 Solving Larger Sequential Problems

Page 217: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 217

4.3. Latches and Flip-Flops

Simplest memory devices: Delay element

ΔTYi yi

yi(t+ΔT) = Yi(t)

ΔT

Yi

yi

In practice, we don’t have to actually insert delay elements because propagation time delays between the inputs and the outputs of the combinatorial part of the circuit provide sufficient delay across the feedback loops.

Page 218: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 218

4.3. Latches and Flip-Flops

Bistable devices:

– Two stable states:

• Q=0 : the device is reset (reset state)

• Q=1: the device is set (set state)

– A bistable device remains in one of two states indefinitely until directed by an input signal to change state.

– Two types:

• Latch

• Flip-flop

Page 219: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 219

4.3. Latches and Flip-Flops

Latch: transparency property:

– Change state when the input values change

– The new output state is delayed only by the propagation time delays of the gates between inputs and outputs of the latch.

– Used to implement the memory part of asynchronous circuits.

Flip-flop: no transparency property

– Has a control (triggering) input, called clock.

– The state change only in response to a transition of a clock pulse at clock input.

– Used to implement memory part of synchronous circuits

Page 220: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 220

SR Latch

Two inputs: S (set), R (reset)

Two complementary outputs: Q, Q’

S Q

R Q’

Q

Q'

S

R

S R Q Q+

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 -

1 1 1 -Indeterminate

Next state

Current state

Q = (R+Q’)’Q’= (S+Q)’

Page 221: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 221

SR Latch S Q

R Q’

Q

Q'

S

R

S R Q+

0 0 Q

0 1 0

1 0 1

1 1 Indeterminate

Equivalent characteristic table

SR=’00’ => Output no changeA logic ‘1’ at inputs can change outputs’ states => active-HIGH latch

Page 222: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 222

SR Latch

S Q

R Q’

Q

Q'

S

R

active-HIGH SR Latch

S Q

R Q’

S

R

Q

Q'

active-LOW SR Latch

Page 223: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 223

SR Latch

Timing chart (NOR implementation)

S

R

Q

Qset reset resetset

Q

Q'

S

R

Page 224: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 224

SR Latch

Timing chart (NAND implementation)

Q

Q

S

R

set reset set reset

S

R

Q

Q'

Page 225: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 225

SR Latch

R

S

Q

Circuit showing feedback

Q+ = R’Q + R’S

SR=0 => Q+ = R’Q + R’S + RS = R’Q + Sfor active-HIGH SR Latch

Q Q+ S R

0 0 0 -

0 1 1 0

1 0 0 1

1 1 - 0

Excitation table

Page 226: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 226

D Latch

D Q

Q’

S Q

R Q’

D

D Q*

0 0

1 1

Q Q* D

0 0 0

0 1 1

1 0 0

1 1 1

Graphic symbol Implementation using SR Latch

Equivalent characteristic table

Excitation tableQ* = D

Page 227: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 227

Gated Latches

S Q E

R Q’

S

R

Q

Q'

E

E: Enable input control

The latch will not change state as long as E=0

E=1 SR=10 => SetE=1 SR=01 => Reset

The operation of latch is synchronizedwith the E input => E: synchronous input

A latch with synchronous input is calledgated latch.

Page 228: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 228

Flip-flops

Latches implement memory part in asynchronous sequential circuits

Flip-flops do the same for synchronous circuits. FF has clock input and changes state synchronously with clock.

Four common types of flip-flops:

– SR

– D

– JK

– T

Page 229: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 229

SR flip-flop

The triangle called dynamic indicator, indicates that the device responds only to an input clock transition from LOW (0) to HIGH (1) => Positive edge-triggered

Appending a small circle to the CLK input indicates that the flip-flop responds only to an input clock transition from HIGH (1) to LOW (0) => Negative edge-triggered

S Q CLK

R Q

S Q CLK

R Q

S Q CLK

R Q

Positive edge-triggered Negative edge-triggered Pulse-triggered(Master-Slave)

Page 230: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 230

SR flip-flop

The information is entered on the leading edge of the clock pulse, but the flip-flop does change state (the output is postponed) until the trailing edge of the clock pulse.

S Q CLK

R Q’

Pulse-triggered(Master-Slave)

Difference between Latch and Flip-flop?

• The flip-flop can not change state except on the triggering edge of clock pulse => synchronous• Present and next states in a latch are separated In time by gate delays, they are separated by clockperiods in a flip-flop.

Page 231: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 231

SR flip-flop

S R Q Q(t+1)

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 -

1 1 1 - Indeterminate

Next stateCurrent state

S R Q(t+1)

0 0 Q(t)

0 1 0

1 0 1

1 1 Indeterminate

Characteristic table

Reduced characteristic table

Q Q(t+1) S R

0 0 0 -

0 1 1 0

1 0 0 1

1 1 - 0

Excitation table

Q(t+1) = R’Q(t) + S(S=1 & R=1) is inhibited

Page 232: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 232

Implementation of SR-FF

CL

S Q

R   Q

Q

Q

S

R

SR-latch

Q

Q

CL

S

R

Implementation of SR-FF by SR-Latch

Page 233: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 233

SR flip-flop

Timing chart

Q

Q

S

R

CL

S Q CLK

R Q

Page 234: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 234

D flip-flop

D flip-flop is useful for storing a single bit

D Q CLK

Q’

S Q CLK

R Q

D

CLK

Positive edge-triggered D flip-flop Implementation using SR flip-flop

Page 235: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 235

D flip-flop

D Q Q(t+1)

0 0 0

0 1 0

1 0 1

1 1 1

Next stateCurrent state

D Q(t+1)

0 0

1 1

Characteristic tableReduced characteristic table

Q Q(t+1) D

0 0 0

0 1 1

1 0 0

1 1 1

Excitation table

Q(t+1) = D

Page 236: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 236

JK flip-flop

JK = 00 => Q* = Q REMEMBER

JK = 01 => Q* = 0 RESET

JK = 10 => Q* = 1 SET

JK = 11 => Q* = not(Q) INVERT

J Q CLK

K Q’

S Q CLK

R Q

Positive edge-triggered JK flip-flop Implementation using SR flip-flop

Page 237: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 237

JK flip-flop

J K Q Q(t+1)

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 0

Next stateCurrent state

J K Q(t+1)

0 0 Q(t)

0 1 0

1 0 1

1 1 [Q(t)]’

Characteristic table

Reduced characteristic table

Q Q(t+1) S R

0 0 0 -

0 1 1 -

1 0 - 1

1 1 - 0

Excitation table

Q(t+1) = K’Q + JQ’

Page 238: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 238

Master-Slave flip-flop

A pulse-triggered flip-flop is a bistable device

– states depend on the values of synchronous inputs at the leading edge of the clock pulse

– those states does not change until the trailling edge of the clock pulse.

Page 239: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 239

Master-Slave flip-flop

A pulse-triggered flip-flop consists of two latches, where one acts as a master and the other acts as a slave => Master-slave flip-flop

S Q E

R Q’

S Q E

R Q’

Master SlaveS

C

R

Q

Q’

Master latch works when C=1Slave latch works when C=0

Page 240: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 240

Edge-Triggered flip-flop

A edge-triggered flip-flop is a bistable device whose state depends on the synchronous inputs either at the positive edge or at the negative edge of a clock pulse.

Page 241: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 241

Edge-Triggered flip-flop

Positive edge-triggered D flip-flop

Q

Q

C

D

Y1

Y2

Page 242: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 242

Edge-Triggered flip-flop

Positive edge-triggered JK flip-flop

Q

Q

CL

J

K

Page 243: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 243

Flip-Flop conversions

Each FF can mutually convertedHow to implement y-FF by using x-FF(1) Prepare expanded state table of y-FF(2) Prepare excitation table of x-FF(3) Combine (1) and (2) (4) Calculate logic function for each input of x-ff

input of y-FF

a   Q   

b Q

Q

Qcom

binatorialcircuit

x-FFCL

CL

Page 244: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 244

Flip-Flop conversions

Example: Implement T-FF using SR-FF

S R Q Q+0 0 0 00 0 1 10 1 0 00 1 1 01 0 0 11 0 1 11 1 0 -1 1 1 -

Expanded state table shows the state transition by the input

T Q 0 0 0 1 1 0 1 1

Q+0110

T-FFSR-FF

Page 245: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 245

Flip-Flop conversions

Example: Implement T-FF using SR-FF

state       inputQ    Q+    S    R0 0 0 -0 1 1 01 0 0 11 1 - 0

SR-FF

S R Q Q+0 0 0 00 0 1 10 1 0 00 1 1 01 0 0 11 0 1 11 1 0 -1 1 1 -

expanded state table excitation table

Excitation table shows the input value corresponding to the state transition

Page 246: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 246

Flip-Flop conversions

Example: Implement T-FF using SR-FF

T Q 0 0 0 1 1 0 1 1

Q+0110

T-FFstate     inputQ    Q+    T0 0 0 0 1 1 1 0 1 1 1 0

excitation table

Page 247: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 247

Flip-Flop conversions

Example: Implement T-FF using SR-FF

T Q 0 0 0 1 1 0 1 1

Q+0110 T Q Q+ S R

0 0 0   0 -0 1 1 - 01 0 1 1 01 1 0 0 1

state       inputQ    Q+    S    R0 0 0 -0 1 1 01 0 0 11 1 - 0

expanded state table of T-FF

excitation table of SR-FF

Page 248: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 248

Flip-Flop conversions

Example: Implement T-FF using SR-FF

Calculate logic function for FF input

0

1

0 1TQ

- 0

0 1

0

1

0 1TQ

0 -

1 0

Karnaugh Map of R Karnaugh Map of S

R=TQ S=TQ

T

S Q

R Q

Q

Q

T Q Q+ S R0 0 0   0 -0 1 1 - 01 0 1 1 01 1 0 0 1

CL

CL

Page 249: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 249

Flip-Flop conversions

Example: Implement D flip-flop using JK FF

D Q 0 0 0 1 1 0 1 1

Q+0011

D Q Q+ J K0 0 0   0 -0 1 0 - 11 0 1 1 -1 1 1 - 0

state     inputQ    Q+    J K 0 0 0 - 0 1 1 -1 0 - 1 1 1 - 0

excitation table of JK-FF

expanded state table of D-FF

Page 250: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 250

Flip-Flop conversions

Example: Implement D flip-flop using JK FF

D Q Q+ J K0 0 0   0 -0 1 0 - 11 0 1 1 - 1 1 1 - 0

0

1

0 1DQ

- 1

1 -

0

1

0 1DQ

0 - - 0

Karnaugh Map of J Karnaugh Map of K

J=D K=D

D

J Q

K Q

Q

Q

CLCL

Page 251: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 251

4. Sequential Systems

4.1 Definitions

4.2 State Tables and Diagrams

4.3 Latches and Flip Flops

4.4 Analysis of Sequential Systems

4.5 Design of Sequential Systems

4.6 Solving Larger Sequential Problems

Page 252: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 252

Design& Analysis flow

diagram for fundamental-mode sequential circuits

Design specifications

Primitive flow table State diagram

State reduction

*Critical race-free state assignment*Transition table

*Next-state equations*Assignment of unspecified outputs

*Output equations

*Circuit excitation table*Latches excitation equations

Circuit logic diagram

Step 1

Step 2

Step 3

Step 4

Step 5

DESIGN

ANALYSIS

Page 253: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 253

A D flip-flop Moore model circuit

D1 = q1q2’ + xq1’

D2 = xq1

z = q2’

1D 1Q

~1Q

~1CLR

1CLK

~1PR

1D 1Q

~1Q

~1CLR

1CLK

~1PR

x

Cl ock

z

q1 q2D1 D2

Page 254: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 254

A D flip-flop Moore model circuit

q1q2q1*q2*

zx=0 x=1

00 00 10 1

01 00 10 0

10 10 11 1

11 00 01 0

001

101

010

110

0

0 0

0

1 1

1

1

Page 255: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 255

A JK flip-flop Moore model circuit

JA = x KA = xB’

JB = KB = x + A’

z = A + B

1J 1Q

~1Q1K

~1CLR

1CLK

~1PR

1J 1Q

~1Q1K

~1CLR

1CLK

~1PRx

Cl ock

A B

z

Page 256: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 256

A JK flip-flop Moore model circuit

ABA*B*

zx=0 x=1

00 01 11 0

01 00 10 1

10 10 01 1

11 11 10 1

000

101

011 11

1

0

0

0

0

1 1

1

1

Page 257: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 257

A D flip-flop Mealy model circuit

D1 = xq1 + xq2

D2 = xq1’q2’

z = zq1

1D 1Q

~1Q

~1CLR

1CLK

~1PR

1D 1Q

~1Q

~1CLR

1CLK

~1PR

x

Cl ock

q1 q2

z

Page 258: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 258

A D flip-flop Mealy model circuit

qq* z

x=0 x=1 x=0 x=1

00 00 01 0 0

01 00 10 0 0

10 00 10 0 1

11 00 10 0 1

Page 259: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 259

5.5. Sequential circuit design

Page 260: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 260

Design& Analysis flow

diagram for fundamental-mode sequential circuits

Design specifications

Primitive flow table State diagram

State reduction

*Critical race-free state assignment*Transition table

*Next-state equations*Assignment of unspecified outputs

*Output equations

*Circuit excitation table*Latches excitation equations

Circuit logic diagram

Step 1

Step 2

Step 3

Step 4

Step 5

DESIGN

ANALYSIS

Page 261: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 261

5.5.2. State reduction

State transition diagram may include redundancy. State reduction technique aims to simplify sequential circuit by reducing redundancy of the state transition diagram.

Equivalence:

– two states are equivalent if output sequences are the same when the same input sequence is given

Method 1: Procedure to get equivalent states

Method 2: Reduction of incompletely specified state table

Page 262: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 262

5.5.2. State reduction

Examples:

0/0

D

C

A

B

E

F

1/0

0/01/1

0/01/1

0/0

1/01/0

0/0 1/00/0 D

CB

E

AF

0/01/1

0/01/1

0/0

1/01/0

0/0 1/00/0

unify A and F

A and F have the same output and transition state for the same input

Page 263: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 263

5.5.2. State reduction

Examples:

D

CB

E

AF

0/01/1

0/01/1

0/0

1/01/0

0/0 1/00/0

unify D and E

CB

AF DE

0/01/0

1/00/0

0/01/1

0/01/1

D and E have the same output and transition state for the same input

Page 264: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 264

5.5.2. State reduction

Examples:

unify B and C

CB

AF DE

0/01/0

1/00/0

0/01/1

0/01/1

BC

AF DE 0/01/0

0/01/1

0/01/0

Page 265: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 265

5.5.2. State reduction

0 1 B C D E E D D FE FB C

0 1 0 0 0 1 0 1 0 00 00 0

ABCDEF

currentstate

next state output

0 1 B C D E E D D AFE AF

0 1 0 0 0 1 0 1 0 00 0

AFBCDE

0 1 B C DE DE DE DE DE AF

0 1 0 0 0 1 0 1 0 0

AFBCDE

0 1 BC BC DE DE DE AF

0 1 0 0 0 1 0 0

AFBCDE

currentstate

currentstate

currentstate

next state

next state next state

output

output output

Page 266: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 266

5.5.2. State reduction

Method 1: Procedure to get equivalent states

– (1) Find multiple states that have the same output with the same input, and treat them as a set of state S1 (s1,s2,…)

– (2) Rewrite state transition table by using the set of state.

– (3) If the next state of the member of the set are different,the set includes nonequivalent state. Then divide the nonequivalent set and iterate (2)

Page 267: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 267

Example of method 1 (1/4)

Reduce the state of the state transition diagram

a

f

e

d

c

b

1/0

0/0

0/1

1/1

1/0

0/11/1

0/0

0/1

1/1

1/0 0/1

0 1 a b d c a b f ed ce a

0 1 0 0 1 1 0 0 1 11 11 0

abcdef

currentstate

next state output

Page 268: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 268

Example of method 1 (2/4)

(1) Find a set of statewith the same output

S1 (a,c)S2 (b,d,e)S3 (f)

(2) Rewrite next state by using set of state

a : S1,S2c : S1,S2

b : S2,S1d : S3,S2e : S2,S1

f : S2,S1

S1

S2

S3

(b,e) and d are not equivakenthence, divide S2 into S2 and S4

a : S1,S2c : S1,S2

b : S4,S1e : S4,S1

f : S2,S1

S1

S2

S3

S4 d : S3,S2

equivalent

equivalent

0 1 a b d c a b f ed ce a

0 1 0 0 1 1 0 0 1 11 11 0

abcdef

currentstate

next state output

Page 269: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 269

Example of method 1 (3/4)

0 1 a b d c a b f ed ce a

0 1 0 0 1 1 0 0 1 11 11 0

abcdef

currentstate

next state output a : S1,S2c : S1,S2

b : S4,S1e : S4,S1

f : S2,S1

S1

S2

S3

S4 d : S3,S2

(2) Rewrite state transition table

0 1 S1 S2 S4 S1 S3 S2 S2 S1

0 1 0 0 1 1 1 1 1 0

S1S2S4S3

currentstate

next state output

Page 270: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 270

Example of method 1 (4/4)

a

f

e

d

c

b

1/0

0/0

0/1

1/1

1/0

0/11/1

0/0

0/1

1/1

0/1 1

32

4

1/0

0/0

0/1

0/1

0/1

1/1

1/11/0

Generate state transition diagram 0 1 S1 S2 S4 S1 S3 S2 S2 S1

0 1 0 0 1 1 1 1 1 0

S1S2S4S3

currentstate

next state output

Page 271: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 271

5.5.2. State reduction

Method 2: Reduction of incompletely specified state table

– 1: Find non compatible pairs

– 2: Find compatible set that doesn’t involve non compatible pairs

– 3: Obtain maximum compatible set

– 4: Calculate minimum closed set

– 5: Generate reduced state transition table

Incompletely specified: don’t care appears in the next state and output

compatible pair: for every input, output are the same

Page 272: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 272

Example of method 2 (1/5)

currentstate

next stateinput X1X000 01 10 11d e b -e - - aa - - e- b e da b f -d c - e

outputinput X1X0

00 01 10 110 - 0 -- 1 - 01 - 0 -- 0 0 -- - - 01 - 1 0

abcdef

a set of not compatible pairs(a,c) (a,f) (b,d) (c,f) (d,f)

Implication table

a b c d e

b

c

d

ef

×

×

×

× ×

1:fill in × at incompatible pair2: fill in conditions to be compatible

de

beadbebf

ae

aedeae

de

○ efadbc

Page 273: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 273

Example of method 2 (2/5)

(a,b,e)

(a,b,c,d,e,f)

(a,b,d,e,f) (b,c,d,e,f)

(a,c)

(a,f)

(a,b,d,e) (b,d,e,f)

(b,d)

(b,c,e,f) (c,d,e,f)

(b,d)

(a,d,e)

(b,d)

(b,e,f) (d,e,f)

(c,f)

(b,e,f)(b,c,e)

(c,f)

(c,d,e) (d,e,f)

(d,f)

(d,e) (e,f)

Maximum compatible set is (a,b,e),(a,d,e),(b,e,f),(b,c,e),(c,d,e)

Decompose state set by non compatible pairs(a,c) (a,f) (b,d) (c,f) (d,f)

remove duplicated noderemove pair involved toother node

Page 274: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 274

Example of method 2 (3/5)

Maximum compatible setC1:(a,b,e)C2:(a,d,e)C3:(b,e,f)C4:(b,c,e)C5:(c,d,e)

Logic function to represent each set involveda: C1+C2b: C1+C3+C4c: C4+C5d: C2+C5e: C1+C2+C4+C5f: C3

Minimum closed set is a subset of maximum compatible set that involves all the stateaxbxcxdxexf = 1(C1+C2)(C1+C3+C4)(C4+C5)(C2+C5)(C1+C2+C4+C5)C3=(C1+C2C3+C2C4)(C2C4+C5) (C1+C2+C4+C5)C3=(C1C5+C2C3C5+C2C4) (C1+C2+C4+C5)C3=(C1C5+C2C3C5+C2C4)C3=C1C3C5+C2C3C5+C2C3C4

hence (C1,C3,C5),(C2,C3,C5),(C2,C3,C4) are candidates for minimum closed set

Page 275: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 275

Example of method 2 (4/5)

C1:(a,b,e)C2:(a,d,e)C3:(b,e,f)C4:(b,c,e)C5:(c,d,e)

candidate for minimum closed set:(C1,C3,C5),(C2,C3,C5),(C2,C3,C4)

Implication table

a b c d e

b

c

d

ef

×

×

×

× ×

de

beadbebf

ae

aedeae

de

○ efadbc

check state transition of each candidate by using Implication table

C1→(d,e)(a,d),(b,e),(b,f),(a,e) →(a,d,e)(b,e,f) →C1,C3C2 →(b,e),(a,d),(b,e),(b,f),(e,f) →(b,e,f)(a,d) →C3,C2C3→(a,e),(d,e),(a,d),(b,c) →(a,d,e)(b,c) →C2,C4C4→(a,e) →(C1|C2)C5→(d,e),(e,f) →(C2|C5),C3

C2,C3,C4 is closed

Page 276: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 276

Example of method 2 (5/5)

C2:(a,d,e),C3:(b,e,f),C4:(b,c,e) are used

currentstate

next stateinput X1X000 01 10 11d e b -e - - aa - - e- b e da b f -d c - e

outputinputX1X0

00 01 10 110 - 0 -- 1 - 01 - 0 -- 0 0 -- - - 01 - 1 0

abcdef

currentstate

next stateinput X1X000 01 10 11C2 C3 C3 C2C2 C4 C3 C2C2 C4 C3 C2

outputinput X1X0

00 01 10 110 0 0 01 1 1 01 1 0 0

C2C3C4

Reduced State Transition Table

Page 277: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 277

5.5.3. State assignment

State assignment is to encode the state table into binary notation, the result is a transition table that combines next-state table and the output table.

Better state allocation results in an easy logic function for input of FF.

SP (Substitution Property): indicator for good state allocation.

a b c d

b da c

C

C1 C2

divide state into blocks so that the next state of the same block exists in the same block

state is allocated to distinguish blocksof SP

Page 278: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 278

5.5.3. State assignment

q1q2q3q4q5q6

q2q3q1q5q6q4

q4q6q5q2q1q3

input Xcurrentstate

next state

0 1

0 0 00 0 10 1 01 0 01 0 11 1 0

0 0 10 1 00 0 01 0 11 1 01 0 0

1 0 01 1 01 0 10 0 10 0 00 1 0

u u u u u u u u u

current state input Xnext state

0 11 2 3 1+ 2+ 3+1+2+ 3+

block 1 (q1,q2,q3)block 2 (q4,q5,q6)

This partition is SP

The first bit is used todistinguish the blocks.

Page 279: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 279

5.6. FF excitation equation

FF excitation equation express each synchronous input of each flip-flop as a function of the present state and the inputs of the circuit.

These Boolean functions are derived directly from the combinational part of the circuit.

Page 280: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 280

5.6. FF excitation equation

Excitation equations:

J = xy2

K = x + y’2D = x’y’2 + y’1y2

Page 281: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 281

Analysis of sequential circuits

Design specifications

Primitive flow table State diagram

State reduction

*Critical race-free state assignment*Transition table

*Next-state equations*Assignment of unspecified outputs

*Output equations

*Circuit excitation table*Latches excitation equations

Circuit logic diagram

Step 1

Step 2

Step 3

Step 4

Step 5

DESIGN

ANALYSIS

Page 282: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 282

Analysis of sequential circuits

Example: analyse this sequential citcuit:

– x: input

– z: output

Page 283: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 283

Analysis of sequential circuits

Excitation equations:

J = xy2

K = x + y’2

D = x’y’2 + y’1y2

Output equations:

z = xy1y’2

y1 y2

Page 284: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 284

Analysis of sequential circuits

PS

y1y2

Output (z)

x = 0 x = 1

00 0 0

01 0 0

10 0 1

11 0 0

PS

y1y2

x = 0 x = 1

J K D J K D

00 0 1 1 0 1 0

01 0 0 1 1 1 1

10 0 1 1 0 1 0

11 0 0 0 1 1 0

Circuit excittion table Output table

Page 285: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 285

Analysis of sequential circuits

Next-state equations:

JK Trigger:

Q(t+1)=Y1, Q = y1

Y1(t+1) = (x+y’2)’y1 + xy2y’1 = x’y1y2 + xy’1y2

D trigger:

Q(t+1)=Y2, Q=y2

Y2(t+1)=D

Y2(t+1)=x’y’2+y’1y2

Page 286: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 286

Analysis of sequential circuits

State table

a=00

b=01

c=10

d=11

PS

y1y2

NS (Y1Y2) Output (z)

x = 0 x = 1 x = 0 x = 1

a b a 0 0

b b d 0 0

c b a 0 1

d c d 0 0

Page 287: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 287

Analysis of sequential circuits

State Diagram

a b d c0/0 1/0 0/0

0/00/0

1/01/1

1/0

PS

y1y2

NS/Output (Y1Y2/z)

x = 0 x = 1

a b/0 a/0

b b/0 d/0

c b/0 a/1

d c/0 d/0

Page 288: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 288

Page 289: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 289

Chapter 5.

Hardware Design Languages

Page 290: Nguyen Thanh Kien Department of Computer Engineering Faculty of Information Technology Hanoi University of Technology Computer Architecture

Page 290