000251_070

Upload: sandystays

Post on 09-Mar-2016

217 views

Category:

Documents


0 download

DESCRIPTION

000251_070

TRANSCRIPT

  • 00.02.51 - 070

    1

    Process control

    Electro/Digital

    Logic circuit

    In previous lessons we learned about various elementary gates. In the presentlesson we will use these gates to compose a number of circuits.

    We will discuss some logic circuits with reference to a number of examples. Indoing so we will refer to some rules from Boolean algebra and to the laws of DeMorgan. The object of this discussion is to simplify the circuit.

    Contents of the lesson

    1 Gate circuits

    2 Boolean algebra

    3 De Morgans law

    4 Circuit diagram

    The copyright in this material is vested in Shell Global Solutions International B.V., The Hague, The Netherlands and Shell Netherlands Raffinaderij B.V. All rightsreserved. Neither the whole or any part of this document may be reproduced, stored in any retrieval system or transmitted in any form by any means (electronic,mechanical, reprographic, recording or otherwise) without the prior written consent of the copyright owner.

  • Process control / 00.02.51 - 070

    2

    Lesson

    1. Gate circuitsA diagram in which various elementary gates are interconnected is referred to asa logic circuit. Previous lessons dealt with the logical expression and the truthtable. We will now explain the relation between the logic circuit and the truthtable with the aid of figure 1.

    5875-070-001-P

    Figure 1Example of a logic circuit

    The best way of determining the total logical expression is to write after everygate in the logic circuit the relevant expression for that particular gate. For theAND gate this expression is A*B and for the OR gate (A*B) + C. Therefore theoutput signal for the complete circuit is Y = (A*B) + C. This is shown in figure 2.

    5875-070-002-P

    Figure 2Elaborated example of the logic circuit

    When writing the truth table it is often practical to make a few intermediatesteps. As the total circuit of the example comprises three inputs, the truth tablemust 23 = 8 combinations of inputs with the associated output signal. For thispurpose we create a table with nine rows. The number of columns is determinedby the number of ingoing and outgoing signals plus the number of intermediatesteps. In the above-mentioned example there are two gates, so that oneintermediate step (the output of the first gate) is sufficient. The truth table cannow comprise 3 + 1 + 1 = 5 columns.

    - logic circuit

    - logical expression

    - truth table

  • Process control / 00.02.51 - 070

    3

    Table 1Truth table for the logic circuit of the exampleC B A A*B ( ) CBAY += *0 0 0 0 00 0 1 0 00 1 0 0 00 1 1 1 11 0 0 0 11 0 1 0 11 1 0 0 11 1 1 1 1

    2. Boolean algebraA logical expression is sometimes referred to as a Boolean expression. To usethese expressions for calculations circuit algebra or Boolean algebra has beendeveloped with the object to simplify the expressions. Simplifying here meansthat the logical expression is so modified that fewer gates are required to obtainthe same effect.

    In fact, we got to know the first fundamental rules for Boolean algebra when wediscussed the elementary gates.In normal mathematics a variable is a quantity that can have a number of values.In Boolean algebra a variable can have only two values: 0 or 1. Starting from avariable A, we can observe the following basic rules:

    Table 2Basic rules in Boolean algebraAND gate OR gate Complement

    00*0 = 000 =+ 10 =01*0 = 101 =+00*1 = 110 =+11*1 = 111 =+

    01 =

    AND gate OR gate Complement00* =A AA =+ 0A1* =A 11 =+AAA*A = AAA =+0A*A = 1=+ AA

    AA =

    These rules are easily proved with the aid of the uppermost set of basic rules.We can only substitute for the variable A the values 0 and 1. When applied tothe rule A*1=A, we get:

    for A = 0 : 0*1 = 0 (= A)for A = 1 : 1*1 = 1 (= A)

    - Boolean expression- circuit algebra

    - variable

  • Process control / 00.02.51 - 070

    4

    Question 1Complete: =AA*

    =+ AA

    3. De Morgans lawsLet us again consider the truth table of an AND gate.Derivation of the first law of De Morgan.

    Table 3We start from an AND gate

    A B Y0 0 00 1 01 0 01 1 1

    Invert all the above values:A B Y1 1 11 0 10 1 10 0 0

    The logical expression for this table is:

    ??? +=

    For the top part of the truth table: Y = A*BInversion of the two terms on either side of the symbol = gives: ?*?? =

    It follows that: ????? +== *

    The first law of De Morgan states that: ???*? +=

    We can do the same derivation with the truth table of an OR gate. We get:

    ?*??? =+

    The result is known as the second law of De Morgan.

    Question 2Explain briefly in words the first and second laws of De Morgan.

  • Process control / 00.02.51 - 070

    5

    4. Circuit diagramUsing the above-mentioned information, we draw up a circuit diagram using anexample from actual practice. In a process three quantities are variable:temperature, level and pressure.

    In this process a valve may only open under the following conditions:1 temperature, high, level high, pressure low;2 temperature high, level low, pressure high;3 temperature high, level low, pressure low;4 temperature low, level low, pressure high.

    In addition:- too high a temperature results in a 1;- too high a level results in a 1;- too high a pressure results in a 1;- opening of the valve gives a 1.

    We will draw up a circuit diagram for this process. This circuit diagram ensuresthat the valve is only opened if all the conditions are satisfied. To do this we firstwrite a truth table for this circuit. As we want to control three quantities, thetruth table has 23 = 8 input combinations. The output of the circuit controls thevalve. In the truth table the outputs are only 1 if the inputs satisfy the combinedconditions. The truth table for this process looks as follows:

    Table 4Truth table

    Temp. Level Pressure Valve0 0 0 00 0 1 10 1 0 00 1 1 01 0 0 11 0 1 11 1 0 11 1 1 0

    We now use this truth table to draw up a logical expression according to thefollowing rules:- we connect any combination whose output has a value causing the valve to

    be open (in this case 1) to an individual AND gate;- all outputs from these various AND gates are connected as an input signal

    to one OR gate.

    In this way the logic circuit of figure 3 is obtained.

    - quantities

  • Process control / 00.02.51 - 070

    6

    5815-070-003-P

    Figure 3Logic circuit

    We compose the relevant logical expression with the aid of the logic circuit. Thelogical expression for the circuit presented in figure 3 is:

    ( ) ( ) ( ) ( )*PL*?P*L?**PL?*P?*L*V +++=Simplifying the above expression is done through the use of the basic rules ofBoolean algebra. One of these basic rules is:

    1=+ ??

    The above-mentioned expression can also be written as:

    ( ) ( ) ( )*PL*?PP*L?*P?*L*V +++=Substitution of 1=+ PP gives:

    ( ) ( ) ( )*PL*?L?*P?*L*V ++=The circuit has now been simplified and only uses eight gates, whereas theoriginal circuit required eleven gates. Simplification can be obtained in variousways by making use of the basic rules and the laws of De Morgan.

    Question 3What rules are applied to draw up a logical expression on the basis of a truthtable?

    An example of a simplification with the aid of the rules of De Morgan is:given the expression:

    ( ) ?*?*??? +=

  • Process control / 00.02.51 - 070

    7

    De Morgan found that:

    ?*??? =+

    Substitution gives:

    ?*?*?*?? =

    or:

    ?*?*?*?? =

    Application of the basic rule:

    gives:

    ?*?? =

    Applying De Morgan again gives:

    ??? +=

    The last basic rule is: ?? =

    substitution of which gives:

    ??? +=

    In this way we have simplified the circuit to only one OR gate. It will be clearthat Boolean algebra and the laws of De Morgan are very important for drawingup circuit diagrams that are as simple as possible.

    Question 4How many gates did the original example have? How many gates are left aftersimplication?

    ??*?? or ?*? ==

  • Process control / 00.02.51 - 070

    8

    SummaryA logical circuit diagram is a diagram that is composed of elementary gates.

    Boolean algebra is calculation with the aid of logical expressions.The object of simplifying logical expressions is to reduce the number of gatesused.

    The basic rules of Boolean algebra are:

    11*100*101*000*0

    ====

    111101110000

    =+=+=+=+

    01

    10

    ==

    0

    100

    ====

    ??*

    ??*???*

    ?*

    1

    110

    =+=+

    =+=+

    ??

    ????

    ?? ?? =

    De Morgan proved that an OR gate with inverted inputs and outputs isequivalent to an AND gate. He further proved that an AND gate with invertedinputs and outputs is equivalent to an OR gate.

    The first law of De Morgan is:

    ?*??? =+

    The second law of De Morgan is:

    ???*? +=

  • Process control / 00.02.51 - 070

    9

    TestExercisesDo not send in your answers for correction

    1. The following logical expression is given:

    ( )*C??? +=In the brackets there is an OR gate with inputs A and B. This OR gate,together with C, forms the input to an AND gate. The total output of thetwo gates is to be inverted. This gives the following logic circuit.

    5815-070-004-P

    Logic circuit of problem 1

    Write the truth table. In the present example we have again three inputs. Inthis case there are three gates, so that in the truth table we can make twointermediate steps. The table therefore gets 9 rows and 6 columns, asfollows. Complete the table.

    Truth table of problem 1C B A BA + ( )*CBA + ( )*CBAY +=0 0 0 00 0 1 10 1 0 10 1 1 11 0 0 01 0 1 11 1 0 11 1 1 1

  • Process control / 00.02.51 - 070

    10

    2. Given the following logic circuit.

    5815-070-005-P

    Logic circuit of problem 2

    Find the logical expression.

    3. Write the truth table for the circuit of problem 2. This table has 3intermediate steps.

    Truth table for problem 3C B A A A*B *CA ( ) ( )*CAA*BY +=0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 01 0 1 01 1 0 01 1 1 1

    4. Derive the second law of De Morgan.

    5. Simplify the following logical expression.

    )(( ) ?*???*? +=6. Write for the following logic circuit a logical expression, and simplify it.

    5815-070-006-P

    Logic circuit for problem 6

  • Process control / 00.02.51 - 070

    11

    Answers to the questions in the lesson

    1 0=??*1=+ AA

    2. The first law of De Morgan is:

    ?*??? =+

    Expressed in words we can say that an AND gate of which all the inputsand output have been inverted is equivalent to an OR gate.

    The second law of De Morgan is:

    ?*??? =+

    We can say of an OR gate in which all the inputs and the output have beeninverted is equivalent to an AND gate.

    3. To draw up a logical expression from a truth table we apply the followingrules:- Connect any combination whose output has a value that results in an

    action being implemented to a separate AND gate;- Connect all outputs of these various AND gates as input signal to one

    OR gate.

    4. In the original example seven gates were required. After simplificationthere remains a circuit with only one gate.

    Answers to the exercises1. See the following table.

    Truth table for problem 1C B A BA + ( )*CBA + ( )*CBAY +=0 0 0 0 0 10 0 1 1 0 10 1 0 1 0 10 1 1 1 0 11 0 0 0 0 11 0 1 1 1 01 1 0 1 1 01 1 1 1 1 0

  • Process control / 00.02.51 - 070

    12

    2. Again we find the logical expression by writing after each gate in thediagram the expression for that gate. For the top AND gate this is ?*? .For the inverter ? .The bottom AND gate gives *C? . Finally, the OR gate result in( ) ( )*C??*? +

    ( ) ( )*C??*?? +=3. See the following table.

    Truth table for problem 3C B A A A*B *CA ( ) ( )*CAA*BY +=0 0 0 1 0 0 00 0 1 0 0 0 00 1 0 1 0 0 0

    0 1 1 0 1 0 11 0 0 1 0 1 11 0 1 0 0 0 01 1 0 1 0 1 11 1 1 0 1 0 1

    4. Derivation of the second law of De Morgan.We start from an OR gate

    A B Y0 0 00 1 11 0 11 1 1

    Invert all the above values:A B Y1 1 11 0 00 1 00 0 0

    The logical expression for this table is ??? *=

    For the top part of the truth table: ??? +=Inversion of the terms on either side of the = symbol gives ??? +=It follows that ?*???? =+=The second law of De Morgan is ?*??? =+

  • Process control / 00.02.51 - 070

    13

    5. ) )(( ?*???*? += 1st law of De Morgan( ) ?*???? ++= ??? =+( ) ?*??? += 1st law of De Morgan

    ?*?*?? = ?? =

    ??*?*? = 0=??*

    0*?? =

    0=?

    6. The logical expression is:

    B*A??? *+=

    Simplify

    ?*A?*?? *= 2nd law of De Morgan

    Or

    100

    00

    *

    =+=

    ==

    ??

    *?

    *??*???

    10

    Morgan De of law1st 0

    =

    =??*