10/19/2009 Last week Processor (CPU) made of millions of transistors Integrated circuits allow small powerful CPUs Control Unit, ALU, Registers, Bus, Cache Co- and multi-core processors Moore’s law: transistors on chip double in 2 yrs 1
10/19/2009 This week How are transistors used to process data? Combining transistors Logic gates The NAND gate Digital circuits Adding two bits Transistors control electricity Control current (0 or 1) via base voltage (0 or 1) An open transistor lets current flow through NPN: open only if base is on (1) PNP: open only if base is off (0) 2
10/19/2009 Transistors control electricity Control current (0 or 1) via base voltage (0 or 1) An open transistor lets current flow through NPN: open only if base is on (1) PNP: open only if base is off (0) Transistors control electricity Control current (0 or 1) via base voltage (0 or 1) An open transistor lets current flow through NPN: open only if base is on (1) PNP: open only if base is off (0) 3
10/19/2009 Combining transistors The NOT gate Can build a NOT gate using 2 transistors If A is 0 then X is 1 If A is 1 then X is 0 Combining transistors The NOT gate Can build a NOT gate using 2 transistors If A is 0 then X is 1 If A is 1 then X is 0 4
10/19/2009 Combining transistors The NOT gate Can build a NOT gate using 2 transistors If A is 0 then X is 1 If A is 1 then X is 0 Logic gates NOT T gate On only when input is off X = NOT A 5
10/19/2009 Logic gates AND gate On when both inputs are on X = AND A, B Logic gates OR gate On when either input is on X = OR A, B 6
10/19/2009 Logic gates NAND D gate NOT AND: On unless both inputs are on X = NAND A, B Logic gates NOR gate NOT OR: On when neither input is on X = NOR A, B 7
10/19/2009 Logic gates XOR gate Exclusive OR: On when only one input is on X = XOR A, B Logic gates XNOR OR gate Exclusive NOT OR: On when both inputs equal X = XNOR A, B 8
10/19/2009 Logic gates The NAND gate Not ot in the exam Buildi ding g a NA NAND Can build a NAND gate using 4 transistors 9
10/19/2009 The NAND gate Not ot in the exam Buildi ding ng a NAND Can build a NAND gate using 4 transistors The NAND gate Not ot in the exam Building lding a NAND Can build a NAND gate using 4 transistors 10
10/19/2009 The NAND gate Not ot in the exam Building lding a NAND Can build a NAND gate using 4 transistors The NAND gate Not ot in the exam Building lding a NAND Can build a NAND gate using 4 transistors 11
10/19/2009 The NAND gate Funct ction ional al Comp mplet eten eness ess Can build a NAND gate using 4 transistors NAND & NOR are simplest 2-input gates NAND is functionally complete (so is NOR) It can be used to build all the other gates e.g. an AND gate In practice, processors contain just NAND gates The NAND gate Funct ction ional al Comp mplet eten eness ess NOT A = NAND A, A AND A, B = NOT (NAND A, B) OR A, B = NAND (NOT A), (NOT B) XOR A, B = OR (AND (NOT A), B), (AND A (NOT B)) 12
10/19/2009 Digital circuits The Half Ad Adder er Adds two bits ( A and B) together (sum S) Carry bit ( C) indicates if sum is more than one bit Digital circuits The Half Ad Adder Sum S = XOR A, B Carry C = AND A, B 13
10/19/2009 Digital circuits The Full Ad Adder When adding column of binary digits may get a carry bit from the previous column Adds together two bits ( A and B) and a carry in bit C1 Carry-out C2 indicates if sum is more than one bit Digital circuits Not ot in the exam The Full Ad Adder Sum S = XOR (XOR A, B), C Carry-out C2 = OR (AND A, B), (AND C1, (XOR A, B)) 14
10/19/2009 Digital circuits Arithm thmetic etic-Log ogic c Unit (ALU) ALU contains circuits for different operations Arithmetic operations Addition (Full adder for each binary column) Subtraction, multiplication, division Logical operations AND, OR, NOT, ... Bitwise operations Shifts, rotations Summary Logic gates are built out of transistors There are many different logic gates NAND is functionally complete Digital circuits process data using gates Half and full adder Reading: Brookshear §1.1, White p.68- 69 http://en.wikipedia.org/wiki/Logic_gate 15
Recommend
More recommend