Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Boolean Algebra

AllenHeard
September 27, 2016

Introduction to Boolean Algebra

Year 12 Lesson

AllenHeard

September 27, 2016
Tweet

More Decks by AllenHeard

Other Decks in Education

Transcript

  1. Objectives • To understand why we may need to simplify

    Boolean expressions • To know how to simplify Boolean expressions using a truth table • To be familiar with Boolean theorems and be able to use these to simplify Boolean expressions
  2. Refresher Complete the truth tables for the following logic gates:

    OR gate AND gate Input A Input B Output 0 0 0 1 1 0 1 1 Input A Input B Output 0 0 0 1 1 0 1 1
  3. Boolean expressions We can write logic diagrams/Boolean logic in the

    form of a Boolean expression. A Boolean expression takes the following form. A AND B is written A.B A OR B is written A + B NOT A is written A We can join these in the same way we join gates.
  4. Boolean expressions • There are two ways in which Boolean

    expressions for a logic system can be formed, either from a truth table or from a logic circuit diagram. • We will now consider each of these in turn starting with the easiest, which is to complete a Boolean expression from a truth table.
  5. Boolean expressions • Consider the following truth table of a

    particular logic system. (Note : at this stage it does not matter what the system is meant to do). C B A Q 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 0 In this table there are four combinations of inputs that will produce an output at Q. In order to write down the Boolean Expression for the whole system we first have to write down the Boolean Equation for each line in the truth table where the output is a 1. All input variables (three in this case) must be included in each Boolean Equation on each line.
  6. Boolean expressions • To obtain the Boolean expression for the

    whole system we simply take each of these terms and ‘OR’ them together. C B A Q Boolean Equation 0 0 0 0 0 0 1 1 A.B.C 0 1 0 0 0 1 1 1 A.B.C 1 0 0 1 A.B.C 1 0 1 1 A.B.C 1 1 0 0 1 1 1 0 Q = A.B.C+A.B.C+A.B.C+A.B.C The expression we obtain from this may not be the simplest possible, we will look at simplification later. We will concentrate to start with on obtaining a correct Boolean expression for a logic system before we attempt to simplify them. After all there is not a lot of point being able to simplify an expression if this is not correct to start with.
  7. Boolean expressions • Complete the truth table by writing in

    the correct Boolean equations and then write the whole expression. C B A Q Boolean Equation 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 Q =
  8. Boolean expressions • Now try one with four inputs, the

    process is exactly the same, it’s just that you now have four variables in each term. Q = D C B A Q Boolean Equation 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 0 1 1 0 1 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0 1 1 1 1 1 0 0 0 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 Q =
  9. Deriving a Boolean Expression from a Logic Circuit • We

    will now look at how to generate the Boolean expressions from a logic circuit diagram, which can be a little more difficult depending on the type of gates involved. • Sometimes we are not given a truth table, but a logic circuit diagram from which we have to derive the Boolean expression. This sounds complicated but as long as you are careful in what you do and work sensibly from the inputs across to the outputs you should be o.k.
  10. Deriving a Boolean Expression from a Logic Circuit • To

    start the process try to divide the circuit into stages as shown below. A B C Q Stage 1 Stage 2 Stage 3 This breaks down a large circuit into smaller more manageable chunks. It would be virtually impossible to write down the expression for Q immediately just by looking at the logic diagram, so don’t even try, you are more than likely to make a mistake. Having identified the different stages in the circuit diagram, we now proceed to write down the Boolean expressions for all of the output sections of stage 1
  11. Deriving a Boolean Expression from a Logic Circuit • Here

    is stage 1 A B C Q Stage 1 Stage 2 Stage 3 A B C
  12. Deriving a Boolean Expression from a Logic Circuit • Now

    we move on to look at the outputs of stage 2, as shown below: A B C Q Stage 1 Stage 2 Stage 3 A B C A.B C
  13. Deriving a Boolean Expression from a Logic Circuit • Finally

    we can complete stage 3, to arrive at the expression for the system as Q=A.B+C A B C Q Stage 1 Stage 2 Stage 3 A B C A.B C
  14. Deriving a Boolean Expression from a Logic Circuit • Now

    consider a much larger system as shown below. Don’t be put off, we will again work through this slowly, one stage at a time. • So to begin with we will work out all of the outputs in stage 1. A B C Q D Stage 1 Stage 2 Stage 3 Stage 4
  15. Deriving a Boolean Expression from a Logic Circuit • Now

    for stage 3, we have to be very careful as for the first time we are going to come across NAND gates, and it is really important to keep terms together, so we use brackets to keep things together.
  16. Deriving a Boolean Expression from a Logic Circuit • In

    stage 4 we combine these two large expressions with a NOR function. Again notice the use of brackets to keep terms together. ) ).( . ( ) . ( D C B A C B A Q + + + =
  17. Exercise 1 • Derive the Boolean Expression for the output

    of the following logic systems. A B C Q Q = …………………………………………………………….
  18. Exercise 2 • Derive the Boolean Expression for the output

    of the following logic systems. A B C Q D Q = …………………………………………………………….
  19. Exercise 3 • Derive the Boolean Expression for the output

    of the following logic systems. A B C Q D Q = …………………………………………………………….
  20. Exercise 4 • Derive the Boolean Expression for the output

    of the following logic systems. A B C Q D Q = …………………………………………………………….
  21. Boolean algebra • The expression we end up with is

    often very long and complex and can result in very complicated logic systems being built. What is needed is a method of simplifying these logic expressions using Boolean algebra. • The introduction of the word algebra may remind many of you of the algebra you used in GCSE Mathematics to solve questions like: • Simplify 2x + 6y. • Giving an answer of 2(x+3y). • Or abc + bcd = bc(a+d) • Or 2xy – 4yz = 2y(x+2z) etc.
  22. Boolean algebra • In order to simplify these long expressions

    we have some laws we follow, these are commutative, distributive, and associative. • Commutative A.B = B.A order doesn’t matter here • Associative A(B.C) = A.B(C) = A.B.C (A+B)+C = A+(B+C) = A+B+C • Distributive A(B+C) = A.B+A.C
  23. Boolean algebra • We also need some rules (identities) to

    follow to make simplification easier, it makes sense to split them up into the three following categories: AND Rules A.0=0 A.1=A A.A=A A.A=0 OR Rules A+0=A A+1=1 A+A=A A+A=1 MISC Rules A=A A+A.B=A A+A.B=A+B (A+B).(A+C)= A+B.C
  24. Boolean algebra • DON’T WORRY about A’s B’s or C’s

    here, they could be anything, so long as the rules are followed, they could be shapes, coloured squares etc. AND Rules A.0=0 A.1=A A.A=A A.A=0 OR Rules A+0=A A+1=1 A+A=A A+A=1 MISC Rules A=A A+A.B=A A+A.B=A+B (A+B).(A+C)= A+B.C
  25. Identity illustration AND Rules A.0=0 A.1=A A.A=A A.A=0 OR Rules

    A+0=A A+1=1 A+A=A A+A=1 MISC Rules A=A A+A.B=A A+A.B=A+B (A+B).(A+C)= A+B.C
  26. Q = A.B.C + A.B.C + A.B Simplifying expressions •

    Simplification can begin by looking for common terms, in this case A is common to all terms so we can remove this outside a bracket as shown below: Q = A.(B.C + B.C + B) Now we can see that B is common to the first two terms inside the bracket, but it is not common to the last term so we cannot include this in the simplification.
  27. Simplifying expressions • Which now becomes: Q = A.(B.(C +

    C ))+ B) • Now using one of our OR identities, C+C=1 the expression now becomes Q = A.(B.(1))+ B)
  28. Simplifying expressions • Using an AND identity, B.1 = B

    the expression becomes: Q = A.(B+ B) • Using the same OR identity, again B+B=1 the expression now becomes Q = A.1 • Finally, A.1=1 so the expression is simplified to: Q = A
  29. Simplifying expressions • Using this mathematical approach the solution where

    common factors were identified in all terms actually made the expression a little bit more complex with the insertion of all the brackets before we were able to start simplification. • If we group pairs of terms instead of the whole, with the intention of obtaining identities such as A+1 or A+A inside the brackets we often reach the simplest solution, without having to insert multiple brackets. • We will solve the same example using this different technique.
  30. Simplifying expressions Q = A.B.C + A.B.C + A.B •

    Simplification can begin by combining the first two terms only as follows: Q = A.B.(C + C)+ A.B
  31. Simplifying expressions Q = A.B.(C + C)+ A.B • Using

    the identity C+C=1 expression now becomes: Q=A.B.1+A.B
  32. Simplifying expressions Q=A.1 • We already know A.1 = A

    so the expression finally becomes Q=A • This is a much simpler way of simplifying an expression
  33. Simplifying expressions Q=A.B+A.B.C+A.B+C Start by looking for possible common factors

    which will leave behind one of our two key identities inside the bracket, in this case A.B in terms 2 and 3. This gives the following simplification. Q=A.B+A.B.(C+1)+C Using the identity C+1=1 the expression now becomes: Q=A.B+A.B.1+C
  34. Simplifying expressions • Again we look for common terms, this

    time between the first two terms to give the following: Q=A.B+A.B+C Q=B(A+A)+C
  35. Exercise 5 • Simplify the following expressions: • 1. Q=A.B+B

    • 2. Q=C.(A+C) • 3. Q=A.B.C+A.C+A.C.D+A.C.D • 4. Q=A.B.(B+C)+B.C+B • 5. Q=B.(A+C)+A+A.(A+B) • 6. Q=A.B.C+B.C+A.B.C+A.B.B • 7. Q=A.B.C+B.C.D+B.C.D+B.C.D+A.B.C+A.B.C • 8. Q=A.B.C.D+A.B.D+A.B.D+A.B.C.D+A.C.D+A.C.D
  36. De Morgan’s Theorem • De Morgan’s Theorem allows the logical

    functions NAND and NOR to be simplified if needed. There are two rules to this: • If you break bar, change the sign underneath • If you complete a bar change the sign underneath where the bar is joined.
  37. More Logic Diagrams • Consider the following circuit. Use the

    process we looked at earlier to derive a Boolean expression for the circuit. Remember to be very careful with the NAND gates. A B C Q D Q = …………………………………………………………….
  38. Applying De Morgan’s thereom • You should have arrived at

    the following: Q=(A.B).(C.D) • Using De Morgan’s theorem we can make it a little bit easier. There is a double bar over the whole expression. This can be removed using rule 1 – if you break the bar, change the sign under the break, what would this give us?
  39. • Breaking the bar and changing the sign would result

    in the following: Q=(A.B)+(C.D) • Now looking at the first term we can see there is a double bar over the expression. This means the term is inverted and inverted again which will result in the original term so this can be removed. Applying De Morgan’s thereom
  40. • Removing the double bar gives us the following: Q=(A.B)+(C.D)

    • Now apply rule 1 again to the right term in the expression and changing the sign. Applying De Morgan’s thereom
  41. • We now have: Q=(A.B)+(C+D) • Once again we have

    a double inversion which can be removed. Q=(A.B)+(C+D) Applying De Morgan’s thereom
  42. • Take the following Boolean expression Q=B.(A+C) Create a logic

    circuit diagram from a Boolean equation A C • First make up the logic for the bracketed term:
  43. • The output then needs to be connected to an

    AND gate with input B as shown below Q=B.(A+C) Create a logic circuit diagram from a Boolean equation A C B Q A C
  44. • Draw the logic circuit diagram for the Boolean expressions

    below: Q=A.B+B.C Q=A+B+A.(C+B) Create a logic circuit diagram from a Boolean equation