Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "1 CHAPTER 3 DIGITAL LOGIC DESIGN © Prepared By: Razif Razali."— Presentation transcript:

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

2 2 CONTENTS –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

3 Introduction to Boolean Algebra Boolean algebra, developed in 1854 by George Boole in his book An Investigation of the Laws of Thought, is a variant of ordinary elementary algebra.Boolean algebra, developed in 1854 by George Boole in his book An Investigation of the Laws of Thought, is a variant of 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

4 4 © Prepared By: Razif Razali

5 Laws & 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

6 Boolean Algebra Boolean IdentityExample AssociativeA + (B + C) = (A + B) + C DistributiveA (B + C) = (A B) + (A C) CommunicativeA + B = B + A De Morgan Theory(A + B)’ = A’. B’ and (A. B)’ = A’ + B’ 6 © Prepared By: Razif Razali

7 Commutative Laws The commutative law of addition for two variables is written as: A+B = B+AThe commutative law of addition for two variables is written as: A+B = B+A The commutative law of multiplication for two variables is written as: AB = BAThe commutative law of multiplication for two variables is written as: AB = BA A B A+B B A B+A A B AB B A BA 7 © Prepared By: Razif Razali

8 Associative 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 B A+(B+C) C A B (A+B)+C C A B A(BC) C A B (AB)C C B+C A+B BC AB 8 © Prepared By: Razif Razali

9 Distributive Laws The distributive law is written for 3 variables as follows: A(B+C) = AB + ACThe distributive law is written for 3 variables as follows: A(B+C) = AB + AC B C A B+C A B C A X X AB AC X=A(B+C) X=AB+AC 9 © Prepared By: Razif Razali

10 Rules of Boolean Algebra _______________________________________________________ A, B, and C can represent a single variable or a combination of variables. 10 © Prepared By: Razif Razali

11 Introduction 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

12 Boolean Algebra In Boolean algebra for a digital system there are only 2 situations or values, that is 0 and 1.In Boolean algebra for a digital system there are only 2 situations or values, that is 0 and 1. Boolean variables normally used to represent voltage value in a wire or input and also output.Boolean variables normally used to represent voltage value in a 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 logic value of 1 and 0.Table below shows some of the situations that represented by logic value of 1 and 0. © Prepared By: Razif Razali 12

13 Example Figure 3.1 shows a Functional Circuit, where a variable A or B can be represented by either 1 or 0.Figure 3.1 shows a Functional Circuit, where a variable A or B can be represented by either 1 or 0. Table 3.2 and Table 3.3 shows the results of the circuit implementation by its representationsTable 3.2 and Table 3.3 shows the results of the circuit implementation by its representations © Prepared By: Razif Razali 13

14 LOGIC GATES 14 © Prepared By: Razif Razali

15 Boolean Algebra to Logic Gates Logic circuits are built from components called logic gates.Logic circuits are built from components called 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

16 AND Gate A B A*B Logic Gate: Series Circuit: ABABA*B000 010 100 111 Truth Table: A*B 16 © Prepared By: Razif Razali

17 Example – AND Gate 17 © Prepared By: Razif Razali

18 A B A+B Logic Gate: Parallel Circuit: A B ABA+B 000 011 101 111 Truth Table: A+B OR Gate 18 © Prepared By: Razif Razali

19 NOT Gates A A’ or A Logic Gate: (also called an inverter) Single-throw Double-pole Switch: A aA 01 10 Truth Table: A’ or A 19 © Prepared By: Razif Razali

20 Example – OR gates Obtain the rules for simplifying the logical expressions: (a) x + 0 which corresponds to the logic gate (b) x + 1 which corresponds to the logic gate x 20 © Prepared By: Razif Razali

21 Solution a)From the truth table for OR, we see that if x is 1 then 1 + 0 = 1, while if x is 0 then 0 + 0 = 0. This can be summarized in the rule that x + 0 = x. b)From the truth table for OR we see that if x is 1 then 1 + 1 = 1, while if x is 0 then 0 + 1 = 1. This can be summarized in the rule that x + 1 = 1. 21 © Prepared By: Razif Razali

22 n-input Gates Because + and * are binary operations, they can be cascaded together to OR or AND multiple inputs.Because + and * are binary operations, they can be cascaded together to OR or AND multiple inputs. A B C A B C A+B+C A B A B C ABC 22 © Prepared By: Razif Razali

23 n -bit Inputs For convenience, it is sometimes useful to think of the logic gates processing n -bits at a time.For convenience, it is sometimes useful to think of the logic gates processing n -bits at a time. This really refers to n instances of the logic gate, not a single logic gate with n -inputs.This really refers to n instances of the logic gate, not a single logic gate with n -inputs. 1101100101 0100110111 1101110111 10001111 00111100 00001100 110001 001110 23 © Prepared By: Razif Razali

24 Exercise Obtain the rules for simplifying the logical expressions:Obtain the rules for simplifying the logical expressions: 24 © Prepared By: Razif Razali

25 Logic Circuits ≡ Boolean Expressions All logic circuits are equivalent to Boolean expressions and any Boolean expression can be rendered as a logic circuit.All logic circuits are equivalent to Boolean expressions and any 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 C B ABC ĀB Y = ABC + ABC+ĀB Y A B C Y Y = AB+BC ¯ ¯ ¯¯ 25 © Prepared By: Razif Razali

26 Exercise Investigate the relationship between the following circuits. Summarize your conclusions using Boolean expressions for the circuits.Investigate the relationship between the following circuits. Summarize your conclusions using Boolean expressions for the circuits. 26 © Prepared By: Razif Razali

27 NAND 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 AND, OR, and NOT.As we will see, can you use these gates wherever you could use AND, OR, and NOT. NAND NORAB ABABABAB001 011 101 110 AB ABABABAB001 010 100 110 27 © Prepared By: Razif Razali

28 XOR 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 both.Unlike OR, XOR is true only when one input or the other is true, not both. XOR XNOR AB ABABABAB 000 011 101 110 ABA B 001 010 100 111 28 © Prepared By: Razif Razali

29 Basic Logic Gates © Prepared By: Razif Razali 29

30 Exercise: Drawing the Circuit Based on the statement below, draw an appropriate circuit 30 © Prepared By: Razif Razali

31 Exercise 1 (To be Submitted) © Prepared By: Razif Razali 31

32 Exercise 2 (To be Submitted) © Prepared By: Razif Razali 32

33 Complex Circuit © Prepared By: Razif Razali 33

34 Complex Circuit © Prepared By: Razif Razali 34

35 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 truth tableA K-Map is a graphical representation of a logic function’s truth 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 the mode of presentation gives more insight.It is really just another way of presenting a truth table, but the mode of presentation gives more insight. A Karnaugh map has zero and one entries at different positions.A Karnaugh map has zero and one entries at different 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

36 Terminology: Minterms A minterm is a special product of literals, in which each input variable appears exactly once.A minterm is a special product of literals, in which each input variable appears exactly once. A function with n variables has 2 n minterms (since each variable can appear complemented or not)A function with n variables has 2 n minterms (since each variable can appear complemented or not) A three-variable function, such as f(x,y,z), has 2 3 = 8 minterms:A three-variable function, such as f(x,y,z), has 2 3 = 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’zx’yz’x’yz xy’z’xy’zxyz’xyz MintermIs true when…Shorthand x’y’z’x=0, y=0, z=0m 0 x’y’zx=0, y=0, z=1m 1 x’yz’x=0, y=1, z=0m 2 x’yzx=0, y=1, z=1m 3 xy’z’x=1, y=0, z=0m 4 xy’zx=1, y=0, z=1m 5 xyz’x=1, y=1, z=0m 6 xyzx=1, y=1, z=1m 7 36 © Prepared By: Razif Razali

37 Terminology: Sum of minterms form Every function can be written as a sum of minterms, which is a special kind of sum of products formEvery function can be written as a sum of minterms, which is a special kind of sum of products form The sum of minterms form for any function is uniqueThe sum of minterms form for any function is unique 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 output is 1.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 output is 1. f = x’y’z’ + x’y’z + x’yz’ + x’yz + xyz’ = m 0 + m 1 + m 2 + m 3 + m 6 =  m(0,1,2,3,6) f’ = xy’z’ + xy’z + xyz = m 4 + m 5 + m 7 =  m(4,5,7) f’ contains all the minterms not in f 37 © Prepared By: Razif Razali

38 38 Re-arranging the truth table A two-variable function has four possible minterms. We can re- arrange these minterms into a Karnaugh map.A two-variable function has four possible minterms. We can re- arrange these minterms into a Karnaugh 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. © Prepared By: Razif Razali

39 39 K-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 m i of the K-map. –Remember that the rightmost columns of the K-map are “switched.”

40 Truth table to K-Map ABP 001 011 100 111 B A01 011 101 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

41 K- Map Method Note the order 41 © Prepared By: Razif Razali

42 K-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 eliminatedAny variable which is both a 1 and a zero in this pairing can be eliminated Pairs may be adjacent horizontally or verticallyPairs may be adjacent horizontally or vertically B A 01 011 11 a pair another pair B is eliminated, leaving A as the term A is eliminated, leaving B as the term The expression becomes A + B 42 © Prepared By: Razif Razali

43 Returning to our car example Two Variable K-MapTwo Variable K-Map ABCP 0000 0010 0101 0110 1001 1010 1101 1110 A.B.C + A.B.C + A.B.C BC A00011110 01 111 One square filled in for each minterm. Notice the code sequence: 00 01 11 10 – a Gray code. 43 © Prepared By: Razif Razali

44 February 2, 2004CS 23144 Karnaugh map simplifications Imagine a two-variable sum of minterms:Imagine a two-variable sum of minterms: x’y’ + x’y Both of these minterms appear in the top row of a Karnaugh map, which means that they both contain the literal x’.Both of these minterms appear in the top row of a Karnaugh map, which means that they both contain the literal x’. What happens if you simplify this expression using Boolean algebra?What happens if you simplify this expression using Boolean algebra? x’y’ + x’y = x’(y’ + y)[ Distributive ] = x’  1[ y + y’ = 1 ] = x’[ x  1 = x ]

45 45 More two-variable examples Another example expression is x’y + xy.Another example expression is x’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 x’y’ + x’y + xy?How about x’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.

46 46 A three-variable Karnaugh map For a three-variable expression with inputs x, y, z, the arrangement of minterms is more tricky:For a three-variable expression with inputs x, y, z, the arrangement of 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):

47 Example of Three Variable © Prepared By: Razif Razali47

48 SEQUENTIAL CIRCUIT Previously, in combinational logic, have output characteristics at one time, which only directly depend on input at that time.Previously, in combinational logic, have output characteristics at one 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 sequential circuit.Circuit that has capability to memorize and store past event is called sequential circuit. Sequential circuit 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 consideration.Sequential circuit 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 consideration. Sequential logic circuits are extremely valuable because of their memory characteristicsSequential logic circuits are extremely valuable because of their memory characteristics © Prepared By: Razif Razali 48

49 Types 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

50 FLIP FLOPS Basic component for a sequential circuit is called flip-flops (also called as latches, bistable multivibrators or binaries.Basic component for a sequential circuit is called flip-flops (also called as latches, bistable multivibrators or 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

51 TYPE 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 NOR gates.Flip flop circuits can be constructed from two NAND gates or two NOR gates. © Prepared By: Razif Razali 51

52 TYPE OF FLIP FLOP - SR © Prepared By: Razif Razali 52

53 TYPE 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

54 TYPE OF FLIP FLOP - JK Refinement of the SR flip flop for indeterminate condition.Refinement of the SR flip flop for indeterminate condition. The most frequently used.The most frequently used. Input J and K behave like input S and R to set and clear the flip-flop respectively.Input J and K behave like input S and R to set and clear the flip-flop respectively. If J = K = 1, clock transition switches the outputs of the flip flop to their complement states.If J = K = 1, clock transition switches the outputs of the flip flop to their complement states. © Prepared By: Razif Razali 54

55 TYPE OF FLIP FLOP - JK © Prepared By: Razif Razali 55

56 TYPE OF FLIP FLOP – D (DELAY) Different from SR and JK flip flop by the number of its input, that it has only one input.Different from SR and JK flip flop by the number of its input, that it has only one input. 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.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. 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

57 TYPE OF FLIP FLOP – D (DELAY) © Prepared By: Razif Razali 57

58 TYPE OF FLIP FLOP – T (TOGGLE) Obtain from JK flip flop when input J and K are connected to provide a single input designated by T.Obtain from JK flip flop when input J and K are connected 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

59 TYPE OF FLIP FLOP – MASTER SLAVE Consists two flip-flop.Consists two flip-flop. The first is the master and respond when clock signal change and become 1, whereas, the second is the slave and respond when clock signal clear to 0.The first is the master and respond when clock signal change and become 1, whereas, the second is the slave and respond when clock signal clear to 0. Output from master will pass to the slave to get the final output.Output from master will pass to the slave to get the final 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 become slave at the same time.Cannot be both flip flop become master or both flip flop become slave at the same time. © Prepared By: Razif Razali 59

60 TYPE OF FLIP FLOP – MASTER SLAVE © Prepared By: Razif Razali 60

61 Summary 61 © Prepared By: Razif Razali


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

Similar presentations


Ads by Google