ex
play

ex Transistors (more in lab) Digital Logic Gates +V cc (Supply Tiny - PowerPoint PPT Presentation

WELLESLEY CS WELLESLEY CS CS 240, Fall 2014 CS 240, Fall 2014 Digital data/computation = Boolean Boolean value ( bit ): 0 or 1 Boolean functions (AND, OR, NOT, ) Digital Logic Electronically : bit = high voltage vs. low voltage 0 1 0


  1. WELLESLEY CS WELLESLEY CS CS 240, Fall 2014 CS 240, Fall 2014 Digital data/computation = Boolean Boolean value ( bit ): 0 or 1 Boolean functions (AND, OR, NOT, …) Digital Logic Electronically : bit = high voltage vs. low voltage 0 1 0 Gate way to computer science 3.3V 2.8V 0.5V 0.0V Boolean functions = logic gates, built from transistors 4 WELLESLEY CS WELLESLEY CS CS 240, Fall 2014 CS 240, Fall 2014 ex Transistors (more in lab) Digital Logic Gates +V cc (Supply Tiny electronic devices that compute basic Boolean functions. Voltage) If Base voltage is high: resistor NOT NAND Current may flow freely V out from Collector to Emitter . Collector V 2 V in V in V out 0 1 Base If Base voltage is low: + V cc Emitter 0 1 0 Current may not flow V 1 1 0 1 from Collector to Emitter . (Ground) + V cc V out V 1 Truth table NOT gate V out V 2 V in V in V out in out in out = = low high 0 1 F T high low 1 0 T F

  2. WELLESLEY CS WELLESLEY CS CS 240, Fall 2014 CS 240, Fall 2014 inputs = variables ex wires = expressions Boolean Algebra Five basic gates: define with truth tables gates = operators/functions for combinational logic circuits = functions A A A B A + B B B 0 1 0 1 NOT NAND NOR (A · B) AND = Boolean product 0 1 0 1 1 0 OR = Boolean sum 1 1 0 1 · 0 1 1 0 + 0 1 0 0 0 0 0 1 1 0 1 1 1 1 0 1 0 1 AND OR A A A A 0 0 NOT = inverse or complement wire = identity 1 1 0 1 0 0 1 0 1 1 WELLESLEY CS WELLESLEY CS CS 240, Fall 2014 CS 240, Fall 2014 ex ex Circuits Translation Connect inputs and outputs of gates with wires. Connect gates to implement these functions. Check with truth tables. Use a direct translation -- it is straightforward and bidirectional. Crossed wires touch only if there is a dot. F = (AB + C)D A B = C Z = W + (X + WY) What is the output if A=1, B=0, C=1? What is the truth table of this circuit? What is an equivalent Boolean expression?

  3. WELLESLEY CS WELLESLEY CS CS 240, Fall 2014 CS 240, Fall 2014 Note on notation: bubble = inverse/complement Commutativity, Associativity A + B A + B A A = B B A B A + B B + A = Identity law, inverse law B A 0 0 + A = A A AB A(BC) A A A (AB)C B BC = B C C A A 0 = A A WELLESLEY CS WELLESLEY CS CS 240, Fall 2014 CS 240, Fall 2014 Note on notation: bubble = inverse/complement Idempotent law, Null/Zero law A A A + B = A + B B B A + A A = A A DeMorgan's Law ( double bubble , toil and trouble, in Randy's words...) A = A B 0 B 0 A 0 = A A A A + B = B

  4. WELLESLEY CS WELLESLEY CS CS 240, Fall 2014 CS 240, Fall 2014 ex ex One law, Absorption law NAND is universal . Write truth tables. Do they correspond to simpler circuits? All Boolean functions can be implemented using only NANDs. Build NOT, AND, OR, NOR, using only NAND gates. A A + 1 = 1 A + AB A = B AB WELLESLEY CS WELLESLEY CS CS 240, Fall 2014 CS 240, Fall 2014 ex ex XOR: Exclusive OR Larger gates Output = 1 if exactly one input = 1. Build a 4-input AND gate using any number of 2-input gates. Truth table: Build from earlier gates: Often used as a one-bit comparator. Video game designers, Halloween costumers extraordinaire, sci-fi/fantasy screenwriters, I have an idea…

  5. WELLESLEY CS WELLESLEY CS CS 240, Fall 2014 Why simplify? CS 240, Fall 2014 ex ex Smaller = cheaper, faster, cooler, Circuit simplification Circuit derivation: code detectors easier to design/build. Is there a simpler circuit that performs the same function? AND gate + NOT gates = code detector, recognizes exactly one input code. Design a 4-input code detector to output 1 if ABCD = 1001, and 0 otherwise. A B Start with an equivalent Boolean expression, then simplify with algebra. C D F(A, B, C) = Design a 4-input code detector to accept two codes (ABCD=1001, ABCD=1111) and reject all others. (accept = 1, reject = 0) Check the answer with a truth table. WELLESLEY CS WELLESLEY CS CS 240, Fall 2014 CS 240, Fall 2014 ex ex Circuit derivation: sum-of-products form Voting machines logical sum (OR) A majority circuit outputs 1 if and only if a majority of its inputs equal 1. Design a majority circuit for three inputs. Use a sum of products. of products (AND) A B C Majority of inputs or their complements (NOT) 0 0 0 0 Draw the truth table and design a sum-of-products circuit for a 4-input code 0 0 1 0 detector to accept two codes (ABCD=1001, ABCD=1111) and reject all others. 0 1 0 0 How are the truth table and the sum-of-products circuit related? 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 Triply redundant computers in spacecraft • Space program also hastened Integrated Circuits.

Recommend


More recommend