1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

61
1 CHAPTER 3 CHAPTER 3 DIGITAL LOGIC DESIGN DIGITAL LOGIC DESIGN © Prepared By: Razif Razali

Transcript of 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Page 1: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

1

CHAPTER 3CHAPTER 3

DIGITAL LOGIC DESIGNDIGITAL LOGIC DESIGN

© Prepared By: Razif Razali

Page 2: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

2

CONTENTSCONTENTS

– Boolean Algebra

– Boolean Operators

– Gates

– Combinational Circuits • Truth Table• Complex Logic Circuit• Boolean Equations

– Karnaugh Maps

– Sequential Circuits• Flip-Flops (SR, D, JK, T & Master-Slave)

© Prepared By:Razif Razali

Page 3: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Introduction to Boolean AlgebraIntroduction to Boolean Algebra

• Boolean algebra, developed in 1854 by George Boole in his Boolean algebra, developed in 1854 by George Boole in his book book An Investigation of the Laws of ThoughtAn Investigation of the Laws of Thought, is a variant of , is a variant of ordinary elementary algebra. ordinary elementary algebra.

• Boolean algebra differs from ordinary algebra in three ways: Boolean algebra differs from ordinary algebra in three ways:

– In the values that variables may assume, which are of a logical instead of a numeric character, prototypically 0 and 1;

– In the operations applicable to those values;

– In the properties of those operations, that is, the laws they obey. Applications include mathematical logic, digital logic, computer programming, set theory, and statistics.

3

© Prepared By:Razif Razali

Page 4: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

4

© Prepared By:Razif Razali

Page 5: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Laws & Rules of Boolean AlgebraLaws & Rules of Boolean Algebra

• The basic laws of Boolean algebra:The basic laws of Boolean algebra:– The commutative laws – The associative laws – The distributive laws – De Morgan Theory

5

© Prepared By:Razif Razali

Page 6: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Boolean AlgebraBoolean Algebra

Boolean Identity Example

Associative A + (B + C) = (A + B) + C

Distributive A (B + C) = (A B) + (A C)

Communicative A + B = B + A

De Morgan Theory (A + B)’ = A’ . B’ and (A . B)’ = A’ + B’

6

© Prepared By:Razif Razali

Page 7: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Commutative LawsCommutative Laws

• The The commutative law of additioncommutative law of addition for two for two variables is written as: variables is written as: A+B = B+AA+B = B+A

• The The commutative law of multiplicationcommutative law of multiplication for for two variables is written as: two variables is written as: AB = BAAB = BA

AB

A+BBA

B+A

AB

ABBA

BA

7 © Prepared By: Razif Razali

Page 8: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Associative LawsAssociative Laws

• The associative law of addition for 3 variables is written as: A+(B+C) = (A+B)+C

• The associative law of multiplication for 3 variables is written as: A(BC) = (AB)C

A

BA+(B+C)

C

A

B(A+B)+C

C

A

BA(BC)

C

A

B(AB)C

C

B+C

A+B

BC

AB

8

© Prepared By:Razif Razali

Page 9: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Distributive LawsDistributive Laws

• The The distributive lawdistributive law is written for 3 variables is written for 3 variables as follows: as follows: A(B+C) = AB + ACA(B+C) = AB + AC

BCA

B+C

AB

CA

XX

AB

AC

X=A(B+C) X=AB+AC

9 © Prepared By: Razif Razali

Page 10: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Rules of Boolean AlgebraRules of Boolean Algebra

1.6

.5

1.4

00.3

11.2

0.1

AA

AAA

AA

A

A

AA

BCACABA

BABAA

AABA

AA

AA

AAA

))(.(12

.11

.10

.9

0.8

.7

_______________________________________________________A, B, and C can represent a single variable or a combination of variables.10

© Prepared By:Razif Razali

Page 11: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Introduction to Digital Logic BasicsIntroduction to Digital Logic Basics

• Hardware consists of a few simple building blocksHardware consists of a few simple building blocks– These are called logic gates

• AND, OR, NOT, … • NAND, NOR, XOR, …

• Logic gates are built using transistorsLogic gates are built using transistors• NOT gate can be implemented by a single transistor• AND gate requires 3 transistors

• Transistors are the fundamental devicesTransistors are the fundamental devices• Pentium consists of 3 million transistors• Compaq Alpha consists of 9 million transistors• Now we can build chips with more than 100 million transistors

11

© Prepared By:Razif Razali

Page 12: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Boolean AlgebraBoolean Algebra

• In Boolean algebra for a digital system there are only 2 situations In Boolean algebra for a digital system there are only 2 situations or values, that is 0 and 1. or values, that is 0 and 1.

• Boolean variables normally used to represent voltage value in a Boolean variables normally used to represent voltage value in a wire or input and also output. wire or input and also output.

• Value 0 and 1 in digital system represent a particular voltage level. Value 0 and 1 in digital system represent a particular voltage level.

• Table below shows some of the situations that represented by Table below shows some of the situations that represented by logic value of 1 and 0. logic value of 1 and 0.

© Prepared By:Razif Razali

12

Page 13: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

ExampleExample• Figure 3.1 shows a Figure 3.1 shows a

Functional Circuit, where Functional Circuit, where a variable A or B can be a variable A or B can be represented by either 1 or represented by either 1 or 0. 0.

• Table 3.2 and Table 3.3 Table 3.2 and Table 3.3 shows the results of the shows the results of the circuit implementation by circuit implementation by its representationsits representations

© Prepared By:Razif Razali

13

Page 14: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

LOGIC GATESLOGIC GATES

14

© Prepared By:Razif Razali

Page 15: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Boolean Algebra to Logic GatesBoolean Algebra to Logic Gates

• Logic circuits are built from components called Logic circuits are built from components called logic gates.logic gates.

• The logic gates correspond to Boolean operations The logic gates correspond to Boolean operations +, *, +, *, ’.’.

• Binary operations have two inputs, unary has oneBinary operations have two inputs, unary has one

OR+

AND*

NOT’’

15

© Prepared By:Razif Razali

Page 16: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

AND GateAND Gate

A

B

A*B

Logic Gate:

Series Circuit:

A B

AA BB A*BA*B

00 00 00

00 11 00

11 00 00

11 11 11

Truth Table:A*B

16

© Prepared By:Razif Razali

Page 17: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Example – AND GateExample – AND Gate

17

© Prepared By:Razif Razali

Page 18: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

A

B

A+B

Logic Gate:

Parallel Circuit:

A

B

AA BB A+BA+B

00 00 00

00 11 11

11 00 11

11 11 11

Truth Table:A+B

OR GateOR Gate

18 © Prepared By: Razif Razali

Page 19: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

NOT GatesNOT Gates

A

A’ or A

Logic Gate:(also called an inverter)

Single-throwDouble-poleSwitch:

A

a A

0 1

1 0

Truth Table:A’ or A

19

© Prepared By:Razif Razali

Page 20: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Example – OR gatesExample – OR gates

Obtain the rules for simplifying the logical expressions:Obtain the rules for simplifying the logical expressions:

(a) x + 0 which corresponds to the logic gate(a) x + 0 which corresponds to the logic gate

(b) x + 1 which corresponds to the logic gate x(b) x + 1 which corresponds to the logic gate x

20

© Prepared By:Razif Razali

Page 21: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

SolutionSolution

a)a) From the truth table for OR, we see that if x is 1 then From the truth table for OR, we see that if x is 1 then 1 + 0 = 11 + 0 = 1, while if x is 0 then , while if x is 0 then 0 + 0 = 00 + 0 = 0. This can be . This can be summarized in the rule that summarized in the rule that x + 0 = x. x + 0 = x.

b)b) From the truth table for OR we see that if x is 1 then From the truth table for OR we see that if x is 1 then 1 + 1 = 11 + 1 = 1, while if x is 0 then , while if x is 0 then 0 + 1 = 10 + 1 = 1. This can be . This can be summarized in the rule that summarized in the rule that x + 1 = 1.x + 1 = 1.

21

© Prepared By:Razif Razali

Page 22: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

n-input Gatesn-input Gates

• Because + and * are binary operations, they can be cascaded Because + and * are binary operations, they can be cascaded together to OR or AND multiple inputs.together to OR or AND multiple inputs.

AB

C

ABC

A+B+C

A+B+C

AB

ABC

ABC

ABC

22

© Prepared By:Razif Razali

Page 23: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

nn-bit Inputs-bit Inputs

• For convenience, it is sometimes useful to think of the logic gates For convenience, it is sometimes useful to think of the logic gates processing processing nn-bits at a time. -bits at a time.

• This really refers to This really refers to nn instances of the logic gate, not a single logic instances of the logic gate, not a single logic gate with gate with nn-inputs.-inputs.

1101100101

01001101111101110111

10001111

0011110000001100

110001 001110

23

© Prepared By:Razif Razali

Page 24: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

ExerciseExercise

• Obtain the rules for simplifying the logical expressions:Obtain the rules for simplifying the logical expressions:

24

© Prepared By:Razif Razali

Page 25: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Logic Circuits Logic Circuits ≡≡ Boolean Expressions Boolean Expressions

• All logic circuits are equivalent to Boolean expressions and All logic circuits are equivalent to Boolean expressions and any any Boolean expression can be rendered as a logic circuit.Boolean expression can be rendered as a logic circuit.

• AND-OR logic circuits are equivalent to sum-of-products form.AND-OR logic circuits are equivalent to sum-of-products form.• Consider the following circuits:Consider the following circuits:

A

CB ABC

ABC

ĀB

Y = ABC + ABC+ĀB

Y

A

B

C

Y

Y = AB+BC

¯

¯

¯ ¯

25

© Prepared By:Razif Razali

Page 26: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

ExerciseExercise

• Investigate the relationship between the following circuits. Investigate the relationship between the following circuits. Summarize your conclusions using Boolean expressions for the Summarize your conclusions using Boolean expressions for the circuits.circuits.

26

© Prepared By:Razif Razali

Page 27: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

NAND and NOR GatesNAND and NOR Gates

• NAND and NOR gates can greatly simplify circuit diagrams. NAND and NOR gates can greatly simplify circuit diagrams. • As we will see, can you use these gates wherever you could use As we will see, can you use these gates wherever you could use

AND, OR, and NOT.AND, OR, and NOT.

NAND

NOR

AA BB AABB

00 00 11

00 11 11

11 00 11

11 11 00

AA BB AABB

00 00 11

00 11 00

11 00 00

11 11 00

27

© Prepared By:Razif Razali

Page 28: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

XOR and XNOR GatesXOR and XNOR Gates

• XOR is used to choose between two mutually exclusive inputs. XOR is used to choose between two mutually exclusive inputs. • Unlike OR, XOR is true only when one input or the other is true, not Unlike OR, XOR is true only when one input or the other is true, not

both.both.

XOR

XNOR

AA BB AABB

00 00 00

00 11 11

11 00 11

11 11 00

A B A B

0 0 1

0 1 0

1 0 0

1 1 1

28

© Prepared By:Razif Razali

Page 29: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Basic Logic GatesBasic Logic Gates

© Prepared By:Razif Razali

29

Page 30: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Exercise: Drawing the CircuitExercise: Drawing the Circuit

Based on the statement below, draw an Based on the statement below, draw an appropriate circuitappropriate circuit

30

EDCBAQ

EDCBAM

].).[(

)]).[((

© Prepared By:Razif Razali

Page 31: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Exercise 1 (To be Submitted)Exercise 1 (To be Submitted)

© Prepared By:Razif Razali

31

Page 32: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Exercise 2 (To be Submitted)Exercise 2 (To be Submitted)

© Prepared By:Razif Razali

32

Page 33: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Complex CircuitComplex Circuit

© Prepared By:Razif Razali

33

Page 34: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Complex CircuitComplex Circuit

© Prepared By:Razif Razali

34

Page 35: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Karnaugh Map (K-Map)Karnaugh Map (K-Map)

• Karnaugh Maps are used for many small design problems.  Karnaugh Maps are used for many small design problems.  • A K-Map is a graphical representation of a logic function’s A K-Map is a graphical representation of a logic function’s

truth tabletruth table• A Karnaugh Map is a grid-like representation of a truth table.  A Karnaugh Map is a grid-like representation of a truth table.  • It is really just another way of presenting a truth table, but It is really just another way of presenting a truth table, but

the mode of presentation gives more insight.  the mode of presentation gives more insight.  • A Karnaugh map has zero and one entries at different A Karnaugh map has zero and one entries at different

positions.  positions.  • Each position in a grid corresponds to a truth table entry.   Each position in a grid corresponds to a truth table entry.   

35

© Prepared By:Razif Razali

Page 36: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Terminology: MintermsTerminology: Minterms• A A mintermminterm is a special product of literals, in which each input variable is a special product of literals, in which each input variable

appears exactly once.appears exactly once.

• A function with n variables has 2A function with n variables has 2nn minterms (since each variable can minterms (since each variable can appear complemented or not)appear complemented or not)

• A three-variable function, such as f(x,y,z), has 2A three-variable function, such as f(x,y,z), has 23 3 = 8 minterms:= 8 minterms:

• Each minterm is true for exactly one combination of inputs:Each minterm is true for exactly one combination of inputs:

x’y’z’ x’y’z x’yz’ x’yzxy’z’ xy’z xyz’ xyz

Minterm Is true when… Shorthandx’y’z’ x=0, y=0, z=0 m0

x’y’z x=0, y=0, z=1 m1

x’yz’ x=0, y=1, z=0 m2

x’yz x=0, y=1, z=1 m3

xy’z’ x=1, y=0, z=0 m4

xy’z x=1, y=0, z=1 m5

xyz’ x=1, y=1, z=0 m6

xyz x=1, y=1, z=1 m7

36

© Prepared By:Razif Razali

Page 37: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Terminology: Sum of minterms formTerminology: Sum of minterms form• Every function can be written as a Every function can be written as a sum of mintermssum of minterms, which is a special , which is a special

kind of sum of products formkind of sum of products form

• The sum of minterms form for any function is The sum of minterms form for any function is uniqueunique

• If you have a truth table for a function, you can write a sum of minterms If you have a truth table for a function, you can write a sum of minterms expression just by picking out the rows of the table where the function expression just by picking out the rows of the table where the function output is 1.output is 1.

x y z f (x,y,z) f ’(x,y,z)

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

f = x’y’z’ + x’y’z + x’yz’ + x’yz + xyz’= m0 + m1 + m2 + m3 + m6

= m(0,1,2,3,6)

f’ = xy’z’ + xy’z + xyz= m4 + m5 + m7

= m(4,5,7)

f’ contains all the minterms not in f

37

© Prepared By:Razif Razali

Page 38: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

38

Re-arranging the truth tableRe-arranging the truth table• A two-variable function has four possible minterms. We can re-A two-variable function has four possible minterms. We can re-

arrange these minterms into a arrange these minterms into a Karnaugh mapKarnaugh map..

• Now we can easily see which minterms contain common literals.Now we can easily see which minterms contain common literals.

– Minterms on the left and right sides contain y’ and y respectively.

– Minterms in the top and bottom rows contain x’ and x respectively.

x y minterm

0 0 x’y’

0 1 x’y

1 0 xy’

1 1 xy

Y

0 1

0 x’y’ x’yX

1 xy’ xy

Y

0 1

0 x’y’ x’yX

1 xy’ xy

Y’ Y

X’ x’y’ x’y

X xy’ xy

© Prepared By:Razif Razali

Page 39: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

39

K-maps from truth tablesK-maps from truth tables• You can also fill in the K-map directly from a truth table.You can also fill in the K-map directly from a truth table.

– The output in row i of the table goes into square mi of the K-map.

– Remember that the rightmost columns of the K-map are “switched.”Y

m0 m1 m3 m2

X m4 m5 m7 m6

Z

x y z f (x,y,z)

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

1 0 0 01 0 1 11 1 0 11 1 1 1

Y

0 1 0 0

X 0 1 1 1

Z

Page 40: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Truth table to K-MapTruth table to K-Map

A B P

0 0 1

0 1 1

1 0 0

1 1 1

B

A 0 1

0 1 1

1 0 1

minterms are represented by a 1 in the corresponding location in the K map.

The expression is:

A.B + A.B + A.B

40 © Prepared By: Razif Razali

Page 41: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

K- Map MethodK- Map Method

Note the order

41

© Prepared By:Razif Razali

Page 42: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

K-MapsK-Maps

• Adjacent 1’s can be “paired off” Adjacent 1’s can be “paired off” • Any variable which is both a 1 and a zero in this pairing can be Any variable which is both a 1 and a zero in this pairing can be

eliminatedeliminated• Pairs may be adjacent horizontally or verticallyPairs may be adjacent horizontally or vertically

B

A 0 1

0 1 1

1 1

a pair

another pairB is eliminated, leaving A as the term A is eliminated,

leaving B as the termThe expression

becomes A + B 42

© Prepared By:Razif Razali

Page 43: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Returning to our car exampleReturning to our car example• Two Variable K-MapTwo Variable K-Map

A B C P

0 0 0 0

0 0 1 0

0 1 0 1

0 1 1 0

1 0 0 1

1 0 1 0

1 1 0 1

1 1 1 0

A.B.C + A.B.C + A.B.C

BC

A 00 01 11 10

0 1

1 1 1One square filled in for each minterm.

Notice the code sequence: 00 01 11 10 – a Gray code.43 © Prepared By: Razif Razali

Page 44: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

February 2, 2004 CS 231 44

Karnaugh map simplificationsKarnaugh map simplifications• Imagine a two-variable sum of minterms:Imagine a two-variable sum of minterms:

x’y’ + x’yx’y’ + x’y

• Both of these minterms appear in the top row of a Karnaugh map, Both of these minterms appear in the top row of a Karnaugh map, which means that they both contain the literal which means that they both contain the literal x’x’..

• What happens if you simplify this expression using Boolean What happens if you simplify this expression using Boolean algebra?algebra?

x’y’ + x’y = x’(y’ + y) [ Distributive ] = x’ 1 [ y + y’ = 1 ] = x’ [ x 1 = x ]

Y

x’y’ x’y

X xy’ xy

Page 45: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

45

More two-variable examplesMore two-variable examples• Another example expression is Another example expression is x’y + xyx’y + xy..

– Both minterms appear in the right side, where y is uncomplemented.

– Thus, we can reduce x’y + xy to just y.

• How about How about x’y’ + x’y + xyx’y’ + x’y + xy??

– We have x’y’ + x’y in the top row, corresponding to x’.

– There’s also x’y + xy in the right side, corresponding to y.

– This whole expression can be reduced to x’ + y.

Y

x’y’ x’y

X xy’ xy

Y

x’y’ x’y

X xy’ xy

Page 46: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

46

A three-variable Karnaugh mapA three-variable Karnaugh map

• For a three-variable expression with inputs x, y, z, the arrangement of For a three-variable expression with inputs x, y, z, the arrangement of minterms is more tricky:minterms is more tricky:

• Another way to label the K-map (use whichever you like):Another way to label the K-map (use whichever you like):

Y

x’y’z’ x’y’z x’yz x’yz’

X xy’z’ xy’z xyz xyz’

Z

Y

m0 m1 m3 m2

X m4 m5 m7 m6

Z

YZ00 01 11 10

0 x’y’z’ x’y’z x’yz x’yz’X

1 xy’z’ xy’z xyz xyz’

YZ00 01 11 10

0 m0 m1 m3 m2X1 m4 m5 m7 m6

Page 47: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Example of Three VariableExample of Three Variable

© Prepared By: Razif Razali 47

Page 48: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

SEQUENTIAL CIRCUITSEQUENTIAL CIRCUIT• Previously, in combinational logic, have output characteristics at one Previously, in combinational logic, have output characteristics at one

time, which only directly depend on input at that time. time, which only directly depend on input at that time.

• Meaning, its doesn’t has capability to memorize or store past event. Meaning, its doesn’t has capability to memorize or store past event.

• Circuit that has capability to memorize and store past event is called Circuit that has capability to memorize and store past event is called sequential circuitsequential circuit..

• Sequential circuit Sequential circuit is a circuit that has an output at one time, which is not is a circuit that has an output at one time, which is not only depends to current input, but also previous input has to come under only depends to current input, but also previous input has to come under consideration. consideration.

• Sequential logic circuitsSequential logic circuits are extremely valuable because of their are extremely valuable because of their memory memory characteristicscharacteristics

© Prepared By:Razif Razali

48

Page 49: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

Types of Sequential CircuitTypes of Sequential Circuit

• There are two types sequential logic circuits system : -There are two types sequential logic circuits system : -– Synchronous

• All changes happen at a decided time by a general signal control at the logic circuits input, which means if there is a clock pulse, changes will happen.

– Asynchronous • There is no general control in this system. Changes in

output happen when input changes.

© Prepared By:Razif Razali

49

Page 50: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

FLIP FLOPS FLIP FLOPS • Basic component for a sequential circuit is called Basic component for a sequential circuit is called flip-flops flip-flops (also called as (also called as latches, latches,

bistable multivibrators bistable multivibrators oror binaries binaries. . • Flip-flops are used for :-Flip-flops are used for :-

– Store bit : 1 bit to store value 1 or 0.– Handle sequential.– Calculate sequential.– Handle duration

• Some types of the flip-flops are :Some types of the flip-flops are :– SR– JK– D– T– Master Slave

• The popular flip-flops types and easy to acquire in market are JK and D.The popular flip-flops types and easy to acquire in market are JK and D.

© Prepared By:Razif Razali

50

Page 51: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

TYPE OF FLIP FLOP - SRTYPE OF FLIP FLOP - SR

• SR flip-flops circuits are the basic of others flip-flop. SR flip-flops circuits are the basic of others flip-flop. • It act as the fundamental for other flip flopIt act as the fundamental for other flip flop• Flip flop circuits can be constructed from two NAND gates or two Flip flop circuits can be constructed from two NAND gates or two

NOR gates.NOR gates.

© Prepared By:Razif Razali

51

Page 52: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

TYPE OF FLIP FLOP - SRTYPE OF FLIP FLOP - SR

© Prepared By:Razif Razali

52

Page 53: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

TYPE OF FLIP FLOP - SRTYPE OF FLIP FLOP - SR• SR flip flop has two input labeled S (Set ) and R ( Reset ) whereSR flip flop has two input labeled S (Set ) and R ( Reset ) where

– S when S = 1 , Q = 1 means to set Q to 1 input S must 1.– R Reset ( set to the previous state ) means if R get input 1, Q will clear to 0.

•   The operation of SR flip-flop is as follows:The operation of SR flip-flop is as follows:– When C ( clock signal ) change from 0 to 1– If S = 0 , R = 1 : Q is clear to 0– If S = 1 , R = 0 : Q is set to 1– If S = R = 0 : Q does not change @ Q(n) = Q( n + 1 )– If S = R = 1 : Q is unpredictable and may go to either 0 or 1 ( this make

SR flip flop difficult to manage, hence, seldom used in practice)

© Prepared By:Razif Razali

53

Page 54: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

TYPE OF FLIP FLOP - JKTYPE OF FLIP FLOP - JK

• Refinement of the SR flip flop for indeterminate Refinement of the SR flip flop for indeterminate condition.condition.

• The most frequently used.The most frequently used.• Input J and K behave like input S and R to set and Input J and K behave like input S and R to set and

clear the flip-flop respectively.clear the flip-flop respectively.• If J = K = 1, clock transition switches the outputs If J = K = 1, clock transition switches the outputs

of the flip flop to their complement states.of the flip flop to their complement states.

© Prepared By:Razif Razali

54

Page 55: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

TYPE OF FLIP FLOP - JKTYPE OF FLIP FLOP - JK

© Prepared By:Razif Razali

55

Page 56: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

TYPE OF FLIP FLOP – D (DELAY)TYPE OF FLIP FLOP – D (DELAY)

• Different from SR and JK flip flop by the number of its input, that Different from SR and JK flip flop by the number of its input, that it has only it has only one inputone input..

• SR flip flop converted to a D flip flop by inserting an inverter SR flip flop converted to a D flip flop by inserting an inverter between S and R and assigning the symbol D to the single input.between S and R and assigning the symbol D to the single input.

• Disadvantages: Disadvantages: – No input condition exists that will leave the state of the D flip flop

unchanged.– Preventing :

• Disable the clock signal • Feedback the output back into the input.

© Prepared By:Razif Razali

56

Page 57: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

TYPE OF FLIP FLOP – D (DELAY)TYPE OF FLIP FLOP – D (DELAY)

© Prepared By:Razif Razali

57

Page 58: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

TYPE OF FLIP FLOP – T (TOGGLE)TYPE OF FLIP FLOP – T (TOGGLE)• Obtain from JK flip flop when input J and K are connected Obtain from JK flip flop when input J and K are connected

to provide a single input designated by T.to provide a single input designated by T.• Has only two conditions:Has only two conditions:

– T = 0 ( J = K = 0 ) : No change– T = 1 ( J = K = 1 ) : Complement the state of the flip flop.

  

© Prepared By:Razif Razali

58

Page 59: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

TYPE OF FLIP FLOP – MASTER TYPE OF FLIP FLOP – MASTER SLAVESLAVE

• Consists two flip-flop.Consists two flip-flop.• The first is the master and respond when clock signal The first is the master and respond when clock signal

change and become 1, whereas, the second is the slave change and become 1, whereas, the second is the slave and respond when clock signal clear to 0.and respond when clock signal clear to 0.

• Output from master will pass to the slave to get the final Output from master will pass to the slave to get the final output.output.

• Only one flip flop function at a time.Only one flip flop function at a time.• Cannot be both flip flop become master or both flip flop Cannot be both flip flop become master or both flip flop

become slave at the same time.become slave at the same time.

© Prepared By:Razif Razali

59

Page 60: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

TYPE OF FLIP FLOP – MASTER TYPE OF FLIP FLOP – MASTER SLAVESLAVE

© Prepared By:Razif Razali

60

Page 61: 1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali.

SummarySummary

61

© Prepared By:Razif Razali