Introduction Gates & Boolean lgebra Boolean algebra: named after mathematician George Boole (85 864). 2-valued algebra. digital circuit can have one of 2 values. Signal between and volt =, between 4 and 5 volts =. Gates calculate various functions of 2 values (like ND). Computers are made up of gates. Gates are made of connected transistors (which are digital circuits). CS 6 Ward CS 6 Ward 2 Combinational Logic Translates a set of n input variables ( or ) by a mapping function (using Boolean operations) to produce a set of m output variables ( or ). i f = F (i,i,, i n- ) i f = F (i,i,, i n- ) F i n- f m- = F m- (i,i,, i n- ) Boolean Operators Basic operators NOT ND OR Other useful operators NND NOR XOR XNOR CS 6 Ward 3 CS 6 Ward 4
NOT (inverter) Operator [] NOT Operator [2] goes in, comes out and vice versa NOT truth table Simplified Circuit: When input (base) V in is low, transistor turns off (infinite resistance) which means output is V cc (typically 5 volts) ( in = out) +5 volts resistor X X = When V in is high, transistor acts like a wire to ground making output volts ( in = out) NOT gate symbol Time to make output change values is a few nanoseconds volts X Inversion bubble CS 6 Ward 5 CS 6 Ward 6 ND Operator NND Operator [] ND truth table B X X = B NND truth table (not and) X = B ND gate symbol B X NND gate symbol Circuit: NOT connected to a NND (next 2 slides) CS 6 Ward 7 CS 6 Ward 8
NND Operator [2] OR Operator Simplified Circuit: If V and V 2 are both high, both transistors will conduct and send the electricity to ground and V out will be low If either V or V 2 (or both) are low, the corresponding transistor resists, not allowing electricity to ground and output is high OR truth table B X X = + B OR gate symbol Circuit: NOT connected to NOR (next 2 slides) CS 6 Ward 9 CS 6 Ward NOR Operator [] NOR Operator [2] NOR truth table (not or) B X X = + B NOR gate symbol Simplified Circuit: If either input V or V 2 is high then transistor will conduct electricity to ground and output will be low If both inputs are low then both transistors resist, making output high CS 6 Ward CS 6 Ward 2
NOR Operator [3] XOR Operator ctual Circuit: Exclusive-OR example Truth table XOR = B = B + B 6 transistors, 5 resistors, & 3 diodes Symbol: CS 6 Ward 3 CS 6 Ward 4 XNOR Operator Gate Manufacturing Technology Exclusive-NOR example Truth table XNOR = B = B + B Symbol: XNO R Bipolar TTL (Transistor-Transistor Logic) workhorse of digital electronics ECL (Emitter-Coupled Logic) very fast MOS (Metal Oxide Semiconductor) slower than bipolar but needs less power and takes up less space so can put a lot on one chip PMOS NMOS CMOS (most modern CPU s and memories) CS 6 Ward 5 CS 6 Ward 6
Boolean Functions combination of Boolean operators F (,B,C) = + BC F 2 (,B,C) = BC + BC + BC + BC = C (by minimizing techniques shown later) Majority Function Truth Table majority function for 3 inputs ( if most inputs are, if most inputs are ) M (, B, C) B C M Recall: + operator means OR & no operator ( B C ) means ND CS 6 Ward 7 CS 6 Ward 8 Majority Function Circuit B C B C _ Majority Boolean Function dash () means (not ) Dots are connections Boolean algebra function for the majority function: M = B C + B C + B C + B C How was this formula (and circuit on previous slide) derived? CS 6 Ward 9 CS 6 Ward 2
Boolean Function from Truth Table [] Boolean Function from Truth Table [2] Boolean algebra function can be derived from any truth table For each in result, ND the row values (use NOT to make row values ) then OR those together Example: Draw circuit for function: X = B + B B X _ ND these rows: B B _ then OR them: B + B X = B + B sum-of-product (sop) form for function CS 6 Ward 2 CS 6 Ward 22 Circuits from SOP Functions [] Steps to implement a circuit:. Write down truth table 2. Provide inverters (NOTs) to generate complement of each input 3. Draw an ND gate for each term with as result 4. Wire the ND gates to inputs 5. Feed outputs of all ND gates to an OR gate 6. Simplify circuit, e.g:. Replace NOT ND with NND, NOT OR with NOR (for efficiency) 2. Replace large-number-of-input (say ) gates with many smaller-number-of-input (<) input gates (for efficiency and timing) Circuits from SOP Functions [2] Why simplification? NND and NOR gates are simpler (faster, smaller) than NOT ND and NOT OR Simpler, faster (?) to use small number of gate types Ultimately, want to implement circuit using a small complete set of operators (discussed later) NND and NOR are both complete because any Boolean function can be implemented with either Faster to use small number of inputs to a gate (fan-in) and small number of gate inputs from a gate output (fan-out) Typically, fan-in and fan-out limited to < CS 6 Ward 23 CS 6 Ward 24
Cascading to Reduce Inputs Basic Laws of Boolean lgebra Boolean algebra follows many algebra rules which can be used to make simpler circuits Example: B + C = ( B + C ) (3 gates vs 2 gates) CS 6 Ward 25 CS 6 Ward 26 Equivalent Gates/Symbols From these Boolean laws (identities), alternative symbols (implementations) for some gates can be derived: NND ND NOR OR Functionally Complete Sets of Gates Not all gate types are typically implemented in circuit design. Simpler if only or 2 types of gates are used. functionally complete set of gates means that any Boolean function can be implemented using only the gates in the set. Examples of functionally complete set ND, OR, NOT ND, NOT OR, NOT NND NOR CS 6 Ward 27 CS 6 Ward 28
NND & NOR Completeness Implement XOR with NNDs [] Exclusive-OR example Truth table (step ) First circuit from truth table (steps 2 5) Making (a) NOT, (b) ND, (c) OR with NND or NOR XOR = B = B + B CS 6 Ward 29 CS 6 Ward 3 Implement XOR with NNDs [2] Using Boolean algebra rules Implement XOR with NNDs [3] Circuits implementing XOR (in addition to the one given from sop on slide 29): Last formula is 3 NND gates (see next slide) CS 6 Ward 3 CS 6 Ward 32
Simplification Other Examples Boolean functions (and therefore circuits) can frequently be manipulated using Boolean laws into simpler functions (circuits), e.g., BC + C + B = (BC + B + C) = (BC + BC) ( + B) ( + B) = ( + B) + ( + B)B = + B + B + BB = ( + B + B) + = = ( + B) ( + B) (BC + B + C) = ( + ) = () = (previous slide) (above) = CS 6 Ward 33 CS 6 Ward 34 XOR Operations [] Recall XOR = B = B + B ( if B; otherwise ) XOR Operations [2] XOR = B = B + B = + = = + = = + = = + = B C = ( B) C = ( B)C + ( B)C = (B + B)C + (B + B)C B = B + B = B B = B + B = B Verify on your own Hint: start with the definition of XNOR = BC + BC + BC + BC (sop form) CS 6 Ward 35 CS 6 Ward 36
Ward 37 CS 6 B C Truth Table B C C B Thus, output TRUE iff odd-number of Boolean variables are TRUE. Used for memory check.