Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Systems 1 Fundamentals of Computing Simplifying Boolean Expressions.

Similar presentations


Presentation on theme: "Computer Systems 1 Fundamentals of Computing Simplifying Boolean Expressions."— Presentation transcript:

1 Computer Systems 1 Fundamentals of Computing Simplifying Boolean Expressions

2 Computer Systems 1 (2004-2005) CS1 - Week 20 Useful logic circuits Simplifying Boolean Expressions Expression laws Karnaugh maps Using simplified expressions to create circuits

3 Computer Systems 1 (2004-2005) Useful Logic Circuit Half adder circuit Used for simple binary addition Two input values X Y Two outputs Sum (z) Carry (c)

4 Computer Systems 1 (2004-2005) Simplifying Boolean Expressions George Boole “Boolean Algebra” Boolean expressions can be derived to explain logic circuits Aided by truth tables Complex expressions (and thus circuits) can often be simplified By using more complex gates NAND, NOR, XOR, etc. Expressions can also be reduced using Boolean algebraic laws Attempt to simplify expressions There are loads! We’ll look at the most useful

5 Computer Systems 1 (2004-2005) Logic Rules Commutative laws: X+Y = Y+X XY = YX Associative laws: X+(Y+Z) = (X+Y)+Z X (YZ) = (XY)Z Distributive laws: X(Y+Z) = XY + XZ X+YZ = (X+Y)(X+Z) De Morgans laws: (X+Y) = X Y (XY) = X+Y

6 Computer Systems 1 (2004-2005) Logic Rules Laws of absorption: X+XY = X X(X+Y) = X Laws of tautology: X+X = X XX = X Law of complementation: X = X Other identities: X+X = 1 XX = 0 X+1 = 1 X1 = X X+0 = X X0 = 0

7 Computer Systems 1 (2004-2005) Logic Rules Example simplification using rules: A.B.C + A.B.C = A.B.(C + C) (Distributive laws) = A.B.1 (useful identities) = A.B (useful identities)

8 Computer Systems 1 (2004-2005) Karnaugh Maps Invented by Maurice Karnaugh Logic expressions quickly become complex to read and understand Simplification is not easy We have to remember all of the laws we can apply to an expression Karnaugh maps provide easy mechanism to simplify expressions Uses a graphical method Does NOT cover all laws Karnaugh map is derived from a truth table and / or expression

9 Computer Systems 1 (2004-2005) Karnaugh Maps Simple example... One square in the table for each row in the truth table Uses a co-ordinate system E.g.- Expression XY + XY + XY Truth Table-> Map->

10 Computer Systems 1 (2004-2005) Karnaugh Maps Once map is drawn we try to simplify the expression Find all adjacent pairs of 1’s (horizontally and vertically) Draw loops round each pair Try to include every 1 on the map in a loop A 1 can belong to more than one loop Use as few loops as possible Loops must group 1’s to the power of 2 2, 4, 8, etc.

11 Computer Systems 1 (2004-2005) Karnaugh Maps Continuing simplification... Take each loop in turn as an individual expression Red loop  Spans X and X but only Y  Therefore we can set it as simply Y  XY+XY = (X+X)Y (Distributive Law)  = Y (useful identities laws) Green loop  Spans Y and Y but only X  Therefore we can set it simply as X  XY+XY = X(Y+Y) (Distributive Law)  =X (useful identities laws) Finally we OR our loop expressions together = X+Y (X OR Y)

12 Computer Systems 1 (2004-2005) Karnaugh Maps Three variable example… Map variables can be drawn in one of two ways OR

13 Computer Systems 1 (2004-2005) Karnaugh Maps Three variable example... XYZ + XYZ + XYZ Green Loop X and Z are constant Y changes = X.Z Red Loop X and Y and constant Z changes = X.Y Expression = X.Y + X.Z = X.(Y+Z)

14 Computer Systems 1 (2004-2005) Karnaugh Maps Three variable example…(alt. method) XYZ + XYZ + XYZ Green loop X and Y are constant Z changes = X.Y Red Loop X and Z are constant Y changes = X.Z Expression = X.Y + X.Z = X.(Y+Z)

15 Computer Systems 1 (2004-2005) Karnaugh Maps Three variable example with grouping Clusters of 1’s can be grouped Groups of four 1’s E.g.- X.Y.Z+X.Y.Z+X.Y.Z+X.Y.Z Z remains constant X changes Y changes Expression = Z

16 Computer Systems 1 (2004-2005) Karnaugh Maps Four variable example Essentially same principals as before Sixteen ‘boxes’ on grid Looking for groupings of 2, 4, and 8 Look for values that remain constant E.g.- X, Y, and Z change W is constant = W

17 Computer Systems 1 (2004-2005) Practice Exercise 1. Write down a Boolean expression for this circuit (3 marks) 2. Using the circuit diagram and your expression from (1) draw a truth table for the logic circuit (4 marks) 3. Using the truth table from (2) draw a Karnaugh map for this system (4 marks) 4. Use the Karnaugh map from (3) to derive a simpler expression for this system (2 marks) 5. Draw this simplified circuit, using the expression in (4) (2 marks) TOTAL=15 marks

18 Computer Systems 1 (2004-2005) Practice Exercise - Answers 1. 2.

19 Computer Systems 1 (2004-2005) Practice Exercise - Answers 3.

20 Computer Systems 1 (2004-2005) Practice Exercise - Answers 4.5. A B C

21 Computer Systems 1 (2004-2005) Week 18- that was easy! Useful logic circuits Simplifying Boolean Expressions Reducing complexity Expression laws Karnaugh maps Two variable Three variable Four variable Using simplified expressions to create circuits


Download ppt "Computer Systems 1 Fundamentals of Computing Simplifying Boolean Expressions."

Similar presentations


Ads by Google