Presentation is loading. Please wait.

Presentation is loading. Please wait.

Boolean Algebra and Logic Gates

Similar presentations


Presentation on theme: "Boolean Algebra and Logic Gates"— Presentation transcript:

1 Boolean Algebra and Logic Gates
EE 240 – Logic Design Chapter 2 Boolean Algebra and Logic Gates Sohaib Majzoub

2 Logic Functions: Boolean Algebra
INVERTER X X’ If X=0 then X’=1 If X=1 then X’=0 A B C=A·B If A=1 AND B=1 then C=1 otherwise C=0 AND OR A B C=A+B If A=1 OR B=1 then C=1 otherwise C=0

3 Axioms of Boolean Algebra
If X ≠ 0 then X = 1 If X ≠ 1 then X = 0 If X = 0 then X’ = 1 If X = 1 then X’ = 0 0 . 0 = = 1 1 . 1 = = 0 0 . 1 = = = = 1

4 Boolean expressions and logic circuits
Any Boolean expression can be implemented as a combination of AND, OR, and NOT X = [A’.(C+D)]’+B.E C D C+D A’.(C+D) [A’.(C+D)]’ [A’.(C+D)]’+B.E A’ A B E B.E

5 Basic Theorems Identity Law Null Element X C=X X 1 C=X X 1 C=1 X C=0
C=X X 1 C=X X·1 = X Null Element X+1 = 1 X 1 C=1 X C=0 X·0 = 0

6 Basic Theorems: Idempotent Laws
X+X = X X C=X X C=X X·X = X

7 Basic Theorems: Involution Law
(X’)’=X B X C=X

8 Basic Theorems: Laws of Complementarity
X+X’ = 1 X X’ C=1 X X’ C=0 X·X’ = 0

9 Expression Simplification using the Basic Theorems
X can be an arbitrarily complex expression. Simplify the following boolean expressions as much as you can using the basic theorems. (A.B’ + D).E + 1 = (A.B’ + D).(A.B’ + D)’ = (A.B + C.D) + (C.D + A) + (A.B + C.D)’ =

10 Associative Law (X+Y)+Z = X+(Y+Z) X Y Z C

11 Associative Law (XY)Z = X(YZ) X Y Z C Y Z X C

12 First Distributive Law
X(Y+Z) = XY+XZ

13 Second Distributive Law
X+YZ = (X+Y)(X+Z)

14 Second Distributive Law (A different proof)
(X + Y)(X + Z) = X(X + Z) + Y(X + Z) (using the first distributive law) = XX + XZ + YX + YZ (using the first distributive law) = X + XZ + YX + YZ (using the idempotent law) = X·1 + XZ + YX + YZ (using the operation with 1 law) = X(1 + Z + Y) + YZ (using the first distributive law) = X·1 + YZ (using the operation with 1 law) = X + YZ (using the operation with 1 law)

15 Distributive Law (Another formula)
X.Y + Z.W = (X+Z).(X+W).(Y+Z).(Y+W) X.Y + Z.W.V =(X+Z).(X+W).(X+V).(Y+Z).(Y+W).(Y+V) Proof?

16 More Theorems Combining Theorem Covering or Absorption Theorem
XY + XY’ = X XY + XY’ = X(Y + Y’) = X·1 = X (X + Y)(X + Y’) = X (X + Y)(X + Y’) = XX + XY’ + YX + YY’ = X + X(Y’ + Y) + 0 = X + X·1 = X Covering or Absorption Theorem X + XY = X X(1 + Y) = X·1 = X X(X + Y) = X X(X + Y) = XX + XY = X·1 + XY = X(1 + Y) = X·1 = X

17 The Consensus Theorem XY + X’Z + YZ = XY + X’Z
XY + X’Z + YZ = XY + X’Z + 1·YZ = XY + X’Z + (X + X’)YZ = XY + X’Z + XYZ + X’YZ = XY + XYZ + X’Z + X’YZ = XY(1 + Z) + X’Z(1 + Y) = XY·1 + X’Z·1 = XY + X’Z (X+Y)(X’+Z)(Y+Z) = (X+Y)(X’+Z)

18 The complement of the sum is equal the product
First DeMorgan’s Law (X+Y)’ = X’Y’ X X Y Z Z Four Different Equivalents of NOR Gate Y X Y X Y Z Z The complement of the sum is equal the product of the complements.

19 The complement of the product is equal the sum
Second DeMorgan’s Law (XY)’ = X’ + Y’ Z Y X Z X Y Four Different Equivalents of NAND Gate X Y X Y Z Z The complement of the product is equal the sum of the complements.

20 Generalized DeMorgan’s Laws
De Morgan’s laws generalize to n variables: (X1 + X2 + X3 + ··· + Xn)’ = X1’X2’X3’ ··· Xn’ (X1X2X3 ··· Xn)’ = X1’ + X2’ + X3’ + ··· + Xn’

21 DeMorgan’s Law (example)
Express the complement f’(w,x,y,z) of the following expression in a simplified form. f(w,x,y,z) = wx(y’z + yz’) f’(w,x,y,z) = w’ + x’ + (y’z +yz’)’ = w’ + x’ + (y’z)’(yz’)’ = w’ + x’ + (y + z’)(y’ + z) = w’ + x’ + yy’ + yz + z’y’ + z’z = w’ + x’ yz + z’y’ + 0 = w’ + x’ + yz + y’z’

22 Principle of Duality Any theorem or identity in switching algebra remains true if  and + are swapped. The dual of a boolean function F is called FD It apply to all theorems that we worked with so far FD(X1,X2,…,Xn,+,.,’) = F(X1,X2,…,Xn,.,+,’) Parentheses has to be added to clarify precedence rules before the conversion

23 Principle of Duality Example: DeMorgan’s Laws – the second law is the dual of the first law (X+Y)’ = X’Y’  (X  Y)’ = X’ + Y’ Another Example: Covering Theorem X + X Y = X The dual is: X  X + Y = X X + Y = X WRONG!!! Why? Use parentheses to avoid problems X+(X.Y) then X.(X+Y)

24 Positive and Negative Logic
Positive Logic: the higher voltage (+V) represents 1 and the lower voltage (0V) represents 0 Negative Logic: the higher voltage (+V) represents 0 and the lower voltage (0V) represents 1

25 Positive and Negative Logic (example)
Gate e2 e3 e1 eo Electric Voltages Positive Logic Negative Logic The same physical circuit implements different logic functions. The function implemented depends on the logic used to interpret the inputs and outputs.

26 NAND: A Functionally Complete Logic Gate
B C=(A·B)’ We can create all three gates (AND, OR, NOT) from NAND NAND as an Inverter A C=(A·A)’ = A’ A B (A·B)’ NAND as an AND C= ((A.B)’)‘= A.B A’ A C= (A’.B’)’ = A+B NAND as an OR B’ B

27 Is NOR Functionally Complete?
Prove it yourself! A B C = (A+B)’

28 Exclusive OR, X-OR, or XOR
X  Y = XY’ + X’Y X Y C If X=1 OR Y=1, but not both of them, then C=1 Commutative Law: X  Y = Y  X X  0 = X  1 = X  X = X  X’ = X X’ 1 Associative Law: (X  Y)  Z= X  ( Y  Z) = X  Y  Z Distributive Law: X(Y  Z) = XY  XZ

29 Exclusive-OR (cont.) Complement Law: (X  Y)’ = X  Y’ = X’  Y
Algebraic Proof: (X  Y)’ = (XY’ + X’Y)’ = (XY’)’(X’Y)’ = (X’ + Y)(X + Y’) = X’X + X’Y’ + XY + YY’ = 0 + X’Y’ + XY + 0 = X’Y’ + XY = X’  Y = XY + X’Y’ = X  Y’

30 Equivalence Gate (X  Y) = XY + X’Y’ X Y C If X=Y then C=1,
otherwise C=0 (X  Y) = (X  Y)’

31 Switch Networks and Switch Design
Basic Ideal Switch: simplest structure in a computing system is a switch Path exists between INPUT and OUTPUT if Switch is CLOSED or ON Path does not exist between INPUT and OUTPUT if SWITCH is OPEN or OFF

32 Switches in Series Truth Table S S2 Path? AND Configuration

33 Switches in Parallel Truth Table S S2 Path? OR Configuration

34 CMOS Switches The idea is to use the series and parallel switch configurations to route signals in a desired fashion. Unfortunately, it is difficult to implement an ideal switch as given. Complementary Metal Oxide Semiconductor (CMOS) devices give us some interesting components. (INPUT) (OUTPUT) (INPUT) (OUTPUT)

35 CMOS Transfer Characteristics
nMOS when CLOSED • Transmits logic level 0 well • Transmits logic level 1 poorly pMOS when CLOSED • Transmits logic level 1 well • Transmits logic level 0 poorly

36 CMOS Transmission Gate

37 CMOS Transmission Gate

38 High Impedance Z With switches, we can consider three states for an output: Logic-0 Logic-1 High Impedance Z Path exists for Logic-0 and Logic-1 when the switch is CLOSED. High impedance is a state where the switch is OPEN.

39 High Impedance Z Another way of thinking of switches is as follows:
Path exists for Logic-0 and Logic-1 when the switch is CLOSED, meaning that the impedance/resistance is small enough to allow ample flow of current. High impedance is a state where the switch is OPEN, meaning that the impedance/resistance is very large allowing nearly no current flow.

40 Inverter (NOT) Network
Truth Table Pull-Up Pull-Down Pull-Up A B A B A B 1 Z 1 Pull-Down 1 Z 1 1 Inverter (NOT) Gate B = A’ = A A B

41 NAND Network Pull-Up Pull-Down Truth Table A B C A B C A B C 0 0 0 0
0 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0 1 0 1 1 1 1 1 1 NAND (NOT AND) Gate A C C = (A.B)’ = (AB)’ = AB B

42 NOR Network Pull-Up Pull-Down Truth Table A B C A B C A B C 0 0 1
Z Z Z Z NOR (NOT OR) Gate A C C = (A+B)’ = (A+B)’ = A+B B

43 AND Network NAND Inverter Truth Table A B C 0 0 0 C 0 1 0 1 0 0 1 1 1
C AND Gate A C C = A.B = AB B

44 OR Network NOR Inverter Truth Table A B C 0 0 0 0 1 1 C 1 0 1 1 1 1
C OR Gate A C C = A+B B

45 XOR Network Truth Table A B C 0 0 0 0 1 1 1 0 1 1 1 0
XOR (Exclusive OR) Gate A C C = A  B = AB’ + A’B B

46 XNOR (Equivalence) Network
Truth Table A B C C A C B XNOR or Equivalence Gate A C = A  B = AB + A’B’ C B


Download ppt "Boolean Algebra and Logic Gates"

Similar presentations


Ads by Google