Presentation is loading. Please wait.

Presentation is loading. Please wait.

Department of Preparatory Year, Umm Al Qura University

Similar presentations


Presentation on theme: "Department of Preparatory Year, Umm Al Qura University"— Presentation transcript:

1 Department of Preparatory Year, Umm Al Qura University
Digital Logic

2 Boolean Algebra to Logic Gates
Logic circuits are built from components called logic gates. The logic gates correspond to Boolean operations +, *, ’. Binary operations have two inputs, unary has one OR + AND * NOT

3 AND A Logic Gate: A*B Truth Table: B A B A*B 1 A B Series Circuit: A*B

4 OR A Logic Gate: A+B Truth Table: B A B A+B 1 A Parallel Circuit: B
1 A Parallel Circuit: B A+B

5 NOT Logic Gate: A A’ or A Truth Table: a A 1 Single-throw Double-pole
(also called an inverter) A A’ or A Truth Table: a A 1 Single-throw Double-pole Switch: A A’ or A

6 n-input Gates Because + and * are binary operations, they can be cascaded together to OR or AND multiple inputs. A A B A+B+C ABC B C A A B A+B+C ABC B C C

7 n-bit Inputs 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. 110001 001110

8 Logic Circuits ≡ Boolean Expressions
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. Consider the following circuits: A y=aB+Bc abc B C A B C Y aBc y Ab y=abc+aBc+Ab

9 NAND and NOR Gates 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. A B AB 1 NAND A B AB 1 NOR

10 XOR and XNOR Gates 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. A B AB 1 XOR A B A B 1 XNOR

11 Properties of NAND AND NOR
NAND and NOR have special properties, but neither satisfies the distributive or associative laws. NAND NOR x1=X x0=X x  0=1 x  1=0 x  x=X x  x=X x  y=X+Y x  y=XY X  Y=x+y X  Y=xy not (x  y)=xy not (x  y)=x+y It should be clear by looking at these properties that NAND and NOR are duals.

12 NAND and NOR as Universal Logic Gates
Any logic circuit can be built using only NAND gates, or only NOR gates. They are the only logic gate needed. Here are the NAND equivalents:

13 NAND and NOR as Universal Logic Gates (cont)
Here are the NOR equivalents: NAND and NOR can be used to reduce the number of required gates in a circuit.

14 Example Problem A hall light is controlled by two light switches, one at each end. Find (a) a truth function, (b) a Boolean expression, and (c) a logic network that allows the light to be switched on or off by either switch. Let x and y be the switches: x y f(x,y) 1 (What kind of gate has this truth table?

15 Slightly more complex Consider my car which complains by sounding a buzzer when I have left the lights on or left the car in gear (not in Park) and taken the keys out of the ignition: 1 P (buzzer) both left lights on left in gear what I’ve done C (keys out = 0) B (in gear = 1) A (lights on = 1) A.B.C + A.B.C + A.B.C

16 Minimization The expression can be simplified in one of two ways:
via algebra via Karnaugh maps to A.C + B.C as the following truth table shows:

17 Truth table shows the same result
1 A.C B.C P A.C + B.C C B A A.B.C + A.B.C + A.B.C = A.C + B.C = (A + B).C

18 Means fewer logic gates are required

19 Minterms and Maxterms 1 P C B A
Notice the truth table has all possible combinations of A,B and C included: The minterm is obtained from the “product” of A,B and C by AND-ing them A.B.C The maxterm is obtained from the “sum” of A,B and C by OR-ing them and inverting inputs A + B + C 1 P C B A

20 Sum of Products/Product of Sums
For all combinations of inputs for which the output is a logical true: Combining the minterms with OR gives the sum- of-products For all combinations of inputs for which the output is a logical false: Combining the maxterms with AND gives the product-of sums.

21 From our example: sum-of-products: A.B.C + A.B.C + A.B.C
1 P C B A sum-of-products: A.B.C + A.B.C + A.B.C product-of-sums: A+B+C . A+B+C . A+B+C . A+B+C . A+B+C Normally the expression is derived using sum-of-products although product-of-sums yields fewer terms when there are more 1 outputs than 0 outputs.

22 Exercise 1 P C B A Write out the sum-of-products expression for the truth table : A.B.C + A.B.C + A.B.C + A.B.C

23 Algebraic Laws DeMorgan’s Laws
The AND and OR functions can be shown to be related to each other through the following equations: Explain that there is a difference between (not A AND not B) and not(A AND B)

24 DeMorgan DeMorgan’s Laws
Example: Implement the expression A.B + C.D using only NAND gates NOT the individual terms Change the sign NOT the lot . not(a.b) not(c.d)

25 Boolean Algebraic Laws
(A.B).C = A.B.C = A.(B.C) Associative A.(B + C) = A.B + A.C A + (B.C) = (A + B).(A + C) Distributive A . B = B . A A + B = B + A Commutative A . 0 = A . 1 = A A + 0 = A A + 1 = 1 Operating with logic 0 and logic 1 A . A = 0 A + A = 1 Complementary A . A = A A + A = A Tautology (Idempotent)

26 Basic rules of Boolean Algebra
Example: Simplify the following Expression A.B + A.C+ A.C + A.B distributive A.(B + B) + A.(C + C) re-distribute A.1 + A.1 complementary A + A op with logic 1 A idempotent Distributive law Communitative law

27 Exercises You should be able to:
Construct truth tables given boolean expressions Compare expressions using truth tables Produce a sum-of-products form from a truth table by combining minterms Simplify the resulting expression algebraically Represent the expression as a circuit using logic gates


Download ppt "Department of Preparatory Year, Umm Al Qura University"

Similar presentations


Ads by Google