# Fall 2006

## 1. Review - Logic Circuits and Switches

• Logic Circuit -- circuit that controls the flow of electricity
• Flow "ON" - represents a binary value of 1, or a logical value of TRUE
• Flow "OFF" - represents a binary value of 0, or a logical value of FALSE
• Logical Circuit is essentially a sophisticated Switch
• A switching circuit can be as simple as a switch connected in series with a lamp.
• Earliest computer (~1930) Electric relays as switches.
• Generation 0 Computers (1940's) - Vacuum Tubes as switches.
• Generation 1 Computers (1950's-1960's) - Transistors as Switches.
• Two Types of Transistors-- NMOS and PMOS. Type is dependent on material added to silicon.
n-type silicon: phosphorus impurities added which makes material more negative (majority of free electrons)
p-type silicon: boron
impurities added which makes material more positive
NMOS Transistor- Source and Drain are n-type and sit on a positively charged well of p-type silicon. When positive voltage (green arrow) is applied to the gate, electrons in the p-type silicon are attracted to the area under the gate, forming an electron channel between the source and the drain. This opens the flow from the drain to the source. In this state the transistor is on.

## 2. Transistors as Building Blocks of Logic Gates

• Combinations of NMOS and PMOS transistors can be used in sequence (connecting output of one to input of another) to produce signals that are functions of the input.

NOT                         AND                             OR
• Logic Tables

## 3. From Gates to Complex Circuits

• AND, OR, and NOT gates form the building blocks of more complex logical and arithmetic circuits.
• Adding two 1-bit numbers:
• 0 + 0 = 0
• 0 + 1 = 1
• 1 + 0 = 1
• 1 + 1 = 0 with a carry of 1
• A circuit that would implement this addition would have two input lines, representing the two numbers to be added, and would need two output lines, representing the sum of the inputs (as a bit) and a possible carry bit.
• Logical Table -- Overhead
• How can we use NOT, AND, OR gates to implement this table?
• The carry output is a simple AND of the two inputs.
• The sum output is more complex.
• Half-Adder Circuit

• Full-Adder: Handles a carry-in from a previous addition

## 4. Exclusive OR

• The Exclusive-OR, or XOR function can be described verbally as, "Either A or B, but not both."
• This is logically the same as  (Not A AND B) OR (A AND NOT B) (Use a table to show equivalence)
• In Class -- design a circuit with 2 NOT gates, 2 AND gates and one OR gate that will implement an XOR function
``` ```