430 likes | 899 Views
Logic Gates. Informatics INFO I101 February 3, 2003 John C. Paolillo, Instructor. Items for Today. Last week Digitization Graphic, audio and video data sizes This time Digital logic, Boolean algebra, and circuits Logic gates and truth tables. Set Theory &Logic. Boolean Algebra.
E N D
Logic Gates Informatics INFO I101 February 3, 2003 John C. Paolillo, Instructor
Items for Today • Last week • Digitization • Graphic, audio and video data sizes • This time • Digital logic, Boolean algebra, and circuits • Logic gates and truth tables
Set Theory&Logic BooleanAlgebra ElectricCircuits Union Intersection Complement OR AND NOT Parallel Series Inversion Binary Arithmetic Addition Multiplication Twos Complement A Fundamental Unity
+ 0 1 0 1 0 00 01 0 0 0 1 01 10 1 0 1 Binary Arithmetic Means zero, carry 1(two distinct outputs)
+ 0 0 1 1 0 1 0 0 0 0 1 1 0 0 0 Exclusive OR 1 1 1 1 0 1 1 0 1 Boolean Algebra AND OR Binary addition:ExOR (for one’s place) plus AND (for carry)
+ off on off on off off on off off off on on on on off on Electric Circuits Parallel Series
A Fundamental Unity • Any logical or mathematical problem may be formulated in set theoretic terms • Boolean logic may be used to represent any set-theoretic operation • The fundamental elements of Boolean logic may be implemented in electric circuits • Therefore, any logical or mathematical problem may be implemented in electrical circuits!
What are Logic Gates? • Logic gates are conventional arrangements of switches that are treated as units • They abstract away from the details of individual switches • They may be implemented in any number of ways • Only their function is important
OR AND XOR Not Buff Symbols for Logic Gates
A ¬A 0 1 1 0 xor nand or xnor nor and 0 0 0 0 0 0 1 1 1 1 1 1 A Buff 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 0 1 0 0 1 1 1 0 0 1 1 0 0 0 Functions of Logic Gates
Boolean Logic Hints AND: if you know that one input is 0, it doesn’t matter what the other input is, the output will be 0 OR: if you know that one input is 1, it doesn’t matter what the other input is, the output will always be 1 XOR: if you know that the inputs are the same, then the output will always be 0
A C E D A 0 1 0 1 B 0 0 1 1 C 0 1 1 1 D 1 1 1 0 E 0 1 1 0 B Synthesizing XOR
A C E B D A 0 1 0 1 B 0 0 1 1 C 1 0 1 0 D 1 1 0 0 E 0 1 1 1 Synthesizing OR from NAND
01 11 r1 row 00 10 r2 c1 c2 black red col Encoding Position in a 2-by-2 Board
col 01 11 r1 00 10 r2 c1 c2 row Decoding Position to a 2-by-2 Board
d c C b A 0 1 0 1 B 0 0 1 1 C a b c d a A B 4-line multiplexer
d c b A 0 1 0 1 a IN 0 0 0 b 0 IN 0 0 c 0 0 IN 0 d 0 0 0 IN B 0 0 1 1 a A B IN 4-line demultiplexer
A E D C B A 0 1 0 1 B 0 0 1 1 C 1 0 1 0 D 1 1 0 0 E 0 0 0 1 Synthesizing AND from NOR
Graphic Paint/Copy Modes COPY OR XOR
Database Search Queries • A keyword represents the set of documents containing it • Boolean AND represents the intersection of the sets corresponding to two (or more) search terms • Boolean OR represents the union of the sets corresponding to two (or more) search terms