Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Microcontroller Programming. Thi Micro Chip PIC (Julio Sanchez, 2007).pdf
Скачиваний:
475
Добавлен:
12.08.2013
Размер:
4.99 Mб
Скачать

Circuits and Logic Gates

81

Current

flow

Figure 5-5 Electrical Symbol for LED

As a simple experiment, connect an LED in series with a 330-ohm resistor to a 5-volt power supply and see how light is emitted for one orientation of the diode and not emitted for the other. This little circuit makes a convenient probe for logic circuits. If the LED’s cathode is touched to some point in a circuit, the LED lights up if the voltage at that point is less than about one or two volts. The LED remains dark if the voltage is greater than this value. This is a 1-bit binary digital voltmeter.

In addition to LEDs, there are logic diodes such as the 1N4148 or its equivalent, the IN914. These are used simply to ensure that the current in some circuit can flow in only one direction. There are also much heftier diodes that are used to manufacture the DC power supplies needed for computers and other electronic equipment. They take the 110-volt AC that comes out of wall outlets and converts it to a unidirectional DC voltage.

5.2 The Transistor

The transistor is a solid state semiconductor device that is used for signal amplification, voltage stabilization, switching, signal modulation, and many other functions. It can be considered as a variable valve which controls the current it draws from a voltage source. Transistors are manufactured as individual components or as part of an integrated circuit. Transistors come in two basic varieties: bipolar and MOS.

5.2.1 Bipolar Transistor

The bipolar transistor was the first type of transistor to be commercially mass-produced. The terminals of a bipolar transistor are named emitter, base, and collector. Physically, the bipolar transistor consists of two n-type regions separated by a thin p-type region or, alternatively, by two p-type regions separated by a thin n-type.

When a transistor has two n-type regions, the device is called an NPN transistor. One of the n-type regions is called the collector, the other the emitter, and the central p-type region the base. The NPN bipolar transistor is shown in Figure 5-6.

 

 

emitter

collector

 

base

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

n-type

 

 

 

p-type

 

NPN

 

 

 

 

 

 

 

 

 

base

TRANSISTOR

 

 

n-type

 

SYMBOL

 

 

 

 

 

 

 

 

 

 

emitter

 

 

collector

 

 

 

Figure 5-6 Bipolar NPN Transistor andSymbol

82

Chapter 5

Simply, a bipolar transistor consists of two diodes connected back to back so that they share a common end. Since the central base region between the collector and emitter is very thin, the device has the unique property of serving as an amplifier. When the transistor's base-to-emitter p-n junction is forward-biased (this could be called the p-n diode) it creates a low resistance in the thin base region. This allows a much larger current to flow from the collector to the emitter. If the base-emitter current is turned off, then the collector-emitter current is also completely turned off. In this case the transistor is said to be cut off.

Over a given range, the collector-emitter current is directly proportional to the base-emitter current. In this manner the transistor amplifies small currents into larger ones, as in radios and other sound amplifying applications. For larger base currents the transistor acts as if there were nearly a short circuit between the collector and the emitter. In this case the transistor is said to be in saturation.

The effect is that a positive voltage on the base turns on the transistor and pulls the output low (to about 0.5 volts). When this voltage is removed, the transistor is turned off and the output is high (+5 volts). The action is that of a current controlled switch, as shown in Figure 5-7.

+5 V

output

input

Current

 

flow

Figure 5-7 NPN Transistor Used as a Switch

The circuit in Figure 5-7 operates as follows: if the input voltage is held at zero volts, the p-n base-emitter junction has no current flowing through it and the output voltage is +5 volts. However, if the input voltage is raised to any value between +2 and +5 volts, a base-emitter current flows. This in turn allows a collector-emitter current to flow and the output voltage is pulled down to ground (typically between 0.5 and 1 V).

An alternative architecture for a bipolar transistor is called PNP. In this case the n-type silicon is sandwiched between two p-types, as shown in Figure 5-8.

Circuits and Logic Gates

83

 

 

 

emitter

emitter

 

 

base

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

p-type

 

 

 

 

n-type

 

PNP

 

 

 

 

 

 

 

base

TRANSISTOR

 

 

 

p-type

 

SYMBOL

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

collector

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

collector

 

Figure 5-8 PNP Transistor and Symbol

The PNP transistor in Figure 5-8 works in the same way as the NPN transistor, except that in the PNP design the base has to have a negative voltage with respect to the emitter in order to turn on the transistor.

5.2.2 MOS Transistor

The second major type of transistor is the metal oxide semiconductor transistor, or

MOS. It consists of two separate n-type regions embedded in p-type silicon. Alternatively, the MOS can consist of two p-type regions embedded in n-type silicon. In the first case the device is called an n-channel MOS (or NMOS) transistor; in the second case it is called a PMOS.

One of the two n-type regions is called the source, and the other is called the drain. An area between the source and the drain consists of a metal contact separated from the p-type body by a thin layer of non-conductive silicon dioxide. This area is called the gate. When a positive voltage is applied to the gate, the electric field attracts a thin layer of electrons into the p-type region underneath the gate. This provides a low resistance path between the two n-type regions. Figure 5-9 shows the construction of an NMOS transistor and the symbols for the NMOS and PMOS.

 

 

 

 

 

 

 

 

insulating

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

oxide

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

layer

 

drain

source

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

N-CHANNEL MOS

 

P-CHANNEL MOS

 

source

 

 

 

 

source

 

 

 

 

TRANSISTOR

 

TRANSISTOR

 

 

 

 

 

 

 

gate

 

 

 

 

 

SYMBOL

 

SYMBOL

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

gate

 

 

 

gate

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

n-type

 

 

 

 

n-type

 

 

 

 

 

 

 

 

 

 

 

 

 

p-type

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

source

drain

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 5-9 MOS Transistor and Symbols

84

Chapter 5

In construction of the MOS transistor the body is connected internally to the source. In the electrical symbols this is indicated by the central wire with an arrow. In the NMOS transistor the direction of the arrow indicates that electrons in the body are attracted to the gate when a positive voltage is applied. This same voltage repels electrons in the PMOS.

One of the most valuable features of the MOS transistors is that they require very small currents to turn on. This makes the MOS transistors behave like volt- age-controlled switches in a digital circuit. Recall that the bipolar transistors operate as current-controlled switches.

5.3 Logic Gates

A logic gate is an electronic device that takes one or more binary signals as inputs and produces a binary output that is a logical function of the input or inputs. The basic logical operations of AND, OR, XOR, and NOT were covered in Section 4.1. Although logic gates can be made from electromagnetic relays, mechanical switches, or optical components, nowadays they are normally implemented using diodes and transistors.

Charles Babbage’s Analytical Engine, developed around 1837, used mechanical logic gates based on gears. Electromagnetic relays were later used for logic gates, and these were eventually replaced by vacuum tubes, since Lee De Forest’s modification of the Fleming valve can be used as an AND logic gate. In 1937, Claude E. Shannon wrote a thesis paper that introduced the use of Boolean algebra in the analysis and design of switching circuits. The first modern electronic gate was invented by Walther Bothe in 1924, for which he received part of the 1954 Nobel Prize in physics.

The primitive types of gate are AND, OR, and NOT; in addition, the XOR gate offers an alternative version of the OR. The other Boolean operations can be implemented by combining the three primitive types. However, for convenience, other combined types have been developed. These are called NAND (NOT plus AND), NOR (NOT plus OR), and XNOR (XOR plus NOT). The advantage of these secondary logic gates is that they require fewer circuit elements for a given function. In fact, the NAND gate is the simplest of all gates, except for the NOT gate. Also, a NAND can implement both a NOT and an OR function; therefore, it can replace AND, OR, and NOT. The NAND gate is the only type actually needed in a real system. Programmable logic arrays very often contain nothing but NAND gates. The symbols for logic gates are shown in Figure 5-10.

The notion of a binary signal is accomplished by allowing it to be in only one of two states. These states are designated as high and low. Conventionally, we represent a high signal with binary digit “1” and a low with a binary digit “0.” True and false and high and low are also associated with binary signals, binary 0 representing false or low and binary 1 representing true or high. In digital electronics, voltage is used to encode binary 0 and 1. A voltage of about 0.5 volts (actually 0 to 0.8 volts) is interpreted as logic 0 and a voltage of about 3.5 volts (actually 2.4 to 5.0 volts) is interpreted as logic 1. Voltages from 0.8 to 2.4 volts are not allowed. This voltage convention is referred to as TTL (transistor-transistor logic).