Application: Digital Logic CircuitsLogic GatesAND-GateOR-GateNOT-GateNAND-GateNOR-GateDisjunctive Normal FormExamples: Disjunctive Normal FormOutput TablesDesigning a CircuitExample: Designing a CircuitSlide 13Slide 14Slide 15Slide 16Conjunctive Normal FormExamples: Conjunctive Normal FormSlide 19Example: Using CNFThe Red Dot-Blue Dot PuzzleSlide 22Application: Digital Logic CircuitsLecture 5Section 1.4Wed, Jan 24, 2007Logic GatesThree basic logic gatesAND-gateOR-gateNOT-gateTwo other gatesNAND-gate (NOT-AND)NOR-gate (NOT-OR)AND-GateOutput is 1 if both inputs are 1.Output is 0 if either input is 0.p q Output1 1 11 0 00 1 00 0 0OR-GateOutput is 1 if either input is 1.Output is 0 if both inputs are 0.p q Output1 1 11 0 10 1 10 0 0NOT-GateOutput is 1 if input is 0.Output is 0 if input is 1.p Output1 00 1NAND-GateOutput is 1 if either input is 0.Output is 0 if both inputs are 1.p q Output1 1 01 0 10 1 10 0 1NOR-GateOutput is 1 if both inputs are 0.Output is 0 if either input is 1.p q Output1 1 01 0 00 1 00 0 1Disjunctive Normal FormA logical expression is in disjunctive normal form ifIt is a disjunction of clauses.Each clause is a conjunction of variables and their negations.Each variable or its negation appears in each clause exactly once.Examples: Disjunctive Normal Formp q (p q) (p q) (p q).p q (p q) (p q).p | q (p q) (p q) (p q).p q p q.Output TablesAn output table shows the output of the circuit for every possible combination of inputs.Inputs Output1 1 01 0 10 1 00 0 0Designing a CircuitWrite an output table for the circuit.Write the expression in disjunctive normal form.Simplify the expression as much as possible.Write the circuit using AND-, OR-, and NOT-gates.Example: Designing a CircuitDesign a circuit for (p q).InputsOutputp q1 1 01 0 10 1 00 0 0Example: Designing a Circuit(p q) is equivalent to p q.Draw the circuit using an AND-gate and a NOT-gate.Example: Designing a CircuitDesign a circuit for (p q) (q r).InputsOutputp q r1 1 1 01 1 0 11 0 1 01 0 0 00 1 1 00 1 0 10 0 1 10 0 0 0Example: Designing a Circuit(p q) (q r) is equivalent to(p q r) (p q r) (p q r).Does this simplify?In any case, we can draw a circuit, although it may not be optimal.Example: Designing a CircuitDesign a logic circuit for (p q) (q r) r.Conjunctive Normal FormA logical expression is in conjunctive normal form ifIt is a conjunction of clauses.Each clause is a disjunction of variables and their negations.Each variable or its negation appears in each clause exactly once.Examples: Conjunctive Normal Formp q p q.p q (p q) (p q).p | q p q.p q (p q) (p q) (p q).Conjunctive Normal FormTo write an expression in CNF,Write the output table (truth table).Follow the procedure for writing the expression in DNF, exceptReverse the rolls of 0 and 1 and and .Example: Using CNFRe-do the previous example(p q) (q r) r.using the conjunctive normal form.The Red Dot-Blue Dot PuzzleThree men apply for a job.They are equally well qualified, so the employer needs a way to choose one.He tells them“On the forehead of each of you I will put either a red dot or a blue dot.”“At least one of you will have a red dot.”“The first one who can tell me the color of the dot on his forehead gets the job.”The Red Dot-Blue Dot PuzzleThe employer proceeds to put a red dot on each man’s forehead.After a few moments, one of them says, “I have a red dot.”How did he
View Full Document