1 / 20

Lecture #22 Truth tables and gates

Lecture #22 Truth tables and gates. This week: Circuits for digital devices. Topics. Today: Combinatorial logic Truth tables And, Or, and Not gates. Combinatorial logic.

aleda
Download Presentation

Lecture #22 Truth tables and gates

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture #22 Truth tables and gates This week: Circuits for digital devices EE 42 fall 2004 lecture 22

  2. Topics Today: • Combinatorial logic • Truth tables • And, Or, and Not gates EE 42 fall 2004 lecture 22

  3. Combinatorial logic Combinatorial logic describes a digital circuit where there are a set of digital inputs, say N wires each one (1) or zero (0) ( example:1=true, 2 volts or 0=false, zero volts) And M digital outputs, M wires each carrying 1 or 0, which are an instantaneous function of the inputs So in combinatorial logic, there is no sequence of events, internal memory or flags, just a straight inputoutput EE 42 fall 2004 lecture 22

  4. Truth Table • A truth table is a general way of describing combinatorial logic, by just listing all of the possible states of the input, and the value of each output which is the result. Lets look at a truth table for “exclusive or” (XOR) Every possible combination of inputs EE 42 fall 2004 lecture 22

  5. In principle, every problem which could be described with discrete inputs (integers, fractions, flags programs!) could be solved with a single combinatorial logic machine. This is very fast once built. But it practice, the combinatorial logic would get too complex, for example the truth table would have 2n rows, where N is the number of Boolean variables needed to take into account all possible inputs. So for complex problems, we use combinatorial logic circuits as steps from state to state of a machine (a “finite state machine”, for example a computer) EE 42 fall 2004 lecture 22

  6. Translating mathematics to machines • So once again, we are in the position of translating mathematics into a machine which can execute the formulas, but this time as digital, Boolean expressions rather than as continuous functions of time and voltage. EE 42 fall 2004 lecture 22

  7. Logical expressions • Fortunately, as Boole pointed out, the language of facts which are true or false are natural to us as a species, and so we can deal with much of Boolean logic intuitively. • However, more complex logic expressions are easier if we have a notation, symbols and rules for manipulation. EE 42 fall 2004 lecture 22

  8. Truth tables with 2 inputs • With just two Boolean inputs, there are four possible combinations, so a truth table for two inputs would have four rows. • 00, 01, 10, 11 • Each of the rows of a possible truth table can have a different Boolean output, so there are 16 different possible truth tables for an expression with two inputs, and they are shown on the next slide EE 42 fall 2004 lecture 22

  9. NOR XOR NAND AND OR

  10. And, Or, and Not are sufficient • As you see from the next slide, with only the functions AND OR and NOT, all of the possible expressions for two inputs can be formed. • Any expression of any number of inputs can be formed using just AND OR, and NOT. • NOR by itself is also complete, but is not as intuitive to use EE 42 fall 2004 lecture 22

  11. False Not (A or B) B and (not A) Not A A and (not B) Not B (A or B) and (not (A and B)) Not (A and B) AND Not (A OR B) B (not A) or (A and B) A A OR (Not B) OR True

  12. NOR is sufficient by itself • NOT A = A NOR A • A AND B = (Not A) NOR (Not B) • A OR B= Not (A NOR B) • So if you can build a NOR circuit, these can be combined to form any Boolean logic expression EE 42 fall 2004 lecture 22

  13. Standard logic notation : AND: “dot” OR : “+ sign” NOT: “bar over symbol for complement” With these basic operations we can construct any logical expression. Order of operation: NOT, AND, OR (note that negation of an expression is performed after the expression is evaluated, so there is an implied parenthesis, e.g. means . Example: Z = A Logical Expressions Examples: X = A · B ; Y = A · B · C Examples: W = A+B ; Z = A+B+C EE 42 fall 2004 lecture 22

  14. Logic Function Example Boolean Expression: H = (A · B · C) + T This can be read H=1 if (A and B and C are 1) or T is 1, or H is true if all of A,B,and C are true, or T is true, or The voltage at node H will be high if the input voltages at nodes A, B and C are high or the input voltage at node T is high EE 42 fall 2004 lecture 22

  15. Logic Function Example 2 You wish to express under which conditions your burglar alarm goes off (B=1): If the “Alarm Test” button is pressed (A=1) OR if the Alarm is Set (S=1) AND { the door is opened (D=1) OR the trunk is opened (T=1)} Boolean Expression: B = A +S(D + T ) This can be read B=1if A = 1 or S=1 AND (D OR T =1), i.e. B=1if {A = 1} or {S=1 AND (D OR T =1)} or B is true IF {A is true} OR {S is true AND D OR T is true} or The voltage at node H will be high if {the input voltage at node A is high} OR {the input voltage at S is high and the voltages at D and T are high} EE 42 fall 2004 lecture 22

  16. A B C T H 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 1 1 0 0 0 1 1 0 1 1 1 1 0 1 1 1 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 Example “Truth Table” Truth Table for Logic Expression H = (A · B · C) + T 0 0 0 1 1 1 1 1 EE 42 fall 2004 lecture 22

  17. Evaluation of Logical Expressions with “Truth Tables” The Truth Table completely describes a logic expression The Truth Table is the fundamental meaning of a logic expression. Two logic expressions are equal if their truth tables are the same EE 42 fall 2004 lecture 22

  18. not A (or ) A Some Important Logical Functions • “AND” • “OR” • “INVERT” or “NOT” • “not AND” = NAND • “not OR” = NOR • exclusive OR = XOR EE 42 fall 2004 lecture 22

  19. AND A C=A·B B A A NOR C=A+B OR B B A NOT Logic Gates These are circuits that accomplish a given logic function such as “OR”. We will shortly see how such circuits are constructed. Each of the basic logic gates has a unique symbol, and there are several additional logic gates that are regarded as important enough to have their own symbol. The set is: AND, OR, NOT, NAND, NOR, and EXCLUSIVE OR. A NAND C = B C = A B EXCLUSIVE OR EE 42 fall 2004 lecture 22

  20. A X C B Y Now we complete the truth tables for X and Y, and from that for C. (Note that X and Y and finally C = X + Y) Logic Circuits It is helpful to list the intermediate logic values (at the input to the OR gate). Let’s call them X and Y. With a combination of logic gates we can construct any logic function. In these two examples we will find the truth table for the circuit. Interestingly, this is the same truth table as the EXCLUSIVE OR EE 42 fall 2004 lecture 22

More Related