## Section6.1Crash Course in Electronics

¶ permalinkAlthough it is not necessary to be an electrical engineer to understand how logic gates work, some basic concepts will help. This section provides a very brief overview of the fundamental concepts of electronic circuits. We begin with two definitions.

- Current
The movement of electrical charge. Electrical charge is measured in

*coulombs*. A flow of one coulomb per second is defined as one*ampere*, often abbreviated as*amp*. Current only flows in a closed path through an electrical circuit.- Voltage
The difference in electrical potential between two points in an electrical circuit. One

*volt*is defined as the potential difference between two points on a conductor when one ampere of current flowing through the conductor dissipates one watt of power.

The electronic circuits that make up a computer are constructed from:

A power source that provides the electrical power.

Passive elements that control current flow and voltage levels.

Active elements that switch between various combinations of the power source, passive elements, and other active elements.

We will look at how each of these three categories of electronic components behaves.

### Subsection6.1.1Power Supplies and Batteries

In almost all countries, the electrical power is supplied to our homes, schools, and businesses in the form of *Alternating Current* (*AC*). A plot of the magnitude of the voltage versus time shows a sinusoidal wave shape. Computer circuits use *direct current* (*DC*) power, which does not vary over time. A *power supply* is used to convert AC power to DC as shown in Figure 6.1.1.

As you probably know, batteries also provide DC power.

Computer circuits distinguish between two different voltage levels to provide logical \(0\) and \(1\text{.}\) For example, logical \(0\) may be represented by \(0.0\) volts DC and logical \(1\) by \(+2.5\) volts DC. Or the reverse may be used, \(+2.5\) volts as logical \(0\) and \(0.0\) volts as logical \(1\text{.}\) The only requirement is that the hardware design be consistent. Fortunately, programmers do not need to be concerned about the actual voltages used.

Electrical engineers typically think of the AC characteristics of a circuit in terms of an ongoing sinusoidal voltage. Although DC power is used, computer circuits are constantly switching between the two voltage levels. Computer hardware engineers need to consider circuit element time characteristics when the voltage is suddenly switched from one level to another. It is this *transient* behavior that will be described in the following sections.

### Subsection6.1.2Resistors, Capacitors, and Inductors

¶ permalinkAll electrical circuits have resistance, capacitance, and inductance.

- Resistance
Dissipates power. The electric energy is transformed into heat.

- Capacitance
Stores energy in an electric field. Voltage across a capacitance cannot change instantaneously.

- Inductance
Stores energy in a magnetic field. Current through an inductance cannot change instantaneously.

All three of these electro-magnetic properties are distributed throughout any electronic circuit. In computer circuits they tend to limit the speed at which the circuit can operate and to consume power, collectively known as *impedance*. Analyzing their effects can be quite complicated and is beyond the scope of this book. Instead, to get a feel for the effects of each of these properties, we will consider the electronic devices that are used to add one of these properties to a specific location in a circuit; namely, resistors, capacitors, and inductors. Each of these circuit devices has a different relationship between the voltage difference across the device and the current flowing through it.

A *resistor* irreversibly transforms electrical energy into heat. It does not store energy. The relationship between voltage and current for a resistor is given by the equation

where \(v\) is the voltage difference across the resistor at time \(t\text{,}\) \(i\) is the current flowing through it at time \(t\text{,}\) and \(R\) is the value of the resistor. Resistor values are specified in *ohms*. The circuit shown in Figure 6.1.2 shows two resistors connected in series through a switch to a battery.

The battery supplies \(2.5\) volts. The Greek letter \(\Omega\) is used to indicate ohms, and \(\mathrm{k}\Omega\) indicates \(10^{3}\) ohms. Since current can only flow in a closed path, none flows until the switch is closed.

Both resistors are in the same path, so when the switch is closed the same current flows through each of them. The resistors are said to be connected in *series*. The total resistance in the path is their sum:

The amount of current can be determined from the application of Equation (6.1.1). Solving for \(i\text{,}\)

\begin{align} i &= \frac{v}{R}\tag{6.1.4}\\ &= \frac{2.5\ \mathrm{volts}}{2.5 \times 10^3\ \mathrm{ohms}}\tag{6.1.5}\\ &= 1.0 \times 10^{-3}\ \mathrm{amps}\tag{6.1.6}\\ &= 1.0\ \mathrm{ma}\tag{6.1.7} \end{align}where “ma” means “milliamps.”

We can now use Equation (6.1.1) to determine the voltage difference between points A and B.

\begin{align} v_{AB}&= i\ R\tag{6.1.8}\\ &= 1.0 \times 10^{-3}\ \mathrm{amps} \times 1.0 \times 10^3\ \mathrm{ohms}\tag{6.1.9}\\ &= 1.0\ \mathrm{volts}\tag{6.1.10} \end{align}Similarly, the voltage difference between points B and C is

\begin{align} v_{BC}&= i\ R\tag{6.1.11}\\ &= 1.0 \times 10^{-3}\ \mathrm{amps} \times 1.5 \times 10^3\ \mathrm{ohms}\tag{6.1.12}\\ &= 1.5\ \mathrm{volts}\tag{6.1.13} \end{align}Figure 6.1.3 shows the same two resistors connected in parallel.

In this case, the voltage across the two resistors is the same: \(2.5\) volts when the switch is closed. The current in each one depends upon its resistance. Thus,

\begin{align} i_1 &= \frac{v}{R_1}\tag{6.1.14}\\ &= \frac{2.5\ \mathrm{volts}}{1.0 \times 10^3\ \mathrm{ohms}}\tag{6.1.15}\\ &= 2.5 \times 10^{-3}\ \mathrm{amps}\tag{6.1.16}\\ &= 2.5\ \mathrm{ma}\tag{6.1.17} \end{align}and

\begin{align} i_2 &= \frac{v}{R_2}\tag{6.1.18}\\ &= \frac{2.5\ \mathrm{volts}}{1.5 \times 10^3\ \mathrm{ohms}}\tag{6.1.19}\\ &= 1.67 \times 10^{-3}\ \mathrm{amps}\tag{6.1.20}\\ &= 1.67\ \mathrm{ma}\tag{6.1.21} \end{align}The total current, \(i_t\text{,}\) supplied by the battery when the switch is closed is divided at point A to supply both the resistors. It must equal the sum of the two currents through the resistors,

\begin{align} i_t &= i_1 + i_2\tag{6.1.22}\\ &= 2.5\ \mathrm{ma} + 1.67\ \mathrm{ma}\tag{6.1.23}\\ &= 4.17\ \mathrm{ma}\tag{6.1.24} \end{align}A *capacitor* stores energy in the form of an electric field. It reacts slowly to voltage changes, requiring time for the electric field to build. The voltage across a capacitor changes with time according to the equation

where C is the value of the capacitor in farads.

Figure 6.1.4 shows a \(1.0\) microfarad capacitor being charged through a \(1.0\) kilohm resistor.

This circuit is a rough approximation of the output of one transistor connected to the input of another. (See Section 6.2.) The output of the first transistor has resistance, and the input to the second transistor has capacitance. The switching behavior of the second transistor depends upon the voltage across the (equivalent) capacitor, \(v_{BC}\text{.}\)

Assuming the voltage across the capacitor, \(v_{BC}\text{,}\) is \(0.0\) volts when the switch is first closed, current flows through the resistor and capacitor. The voltage across the resistor plus the voltage across the capacitor must be equal to the voltage available from the battery. That is,

\begin{equation} 2.5 = i\ R + v_{BC}\tag{6.1.26} \end{equation}If we assume that the voltage across the capacitor, \(v_{BC}\text{,}\) is \(0.0\) volts when the switch is first closed, the full voltage of the battery, \(2.5\) volts, will appear across the resistor. Thus, the initial current flow in the circuit will be

\begin{align} i_{\mathrm{initial}} &= \frac{2.5\ \mathrm{volts}}{1.0\ \mathrm{k}\Omega}\tag{6.1.27}\\ &= 2.5\ \mathrm{ma}\tag{6.1.28} \end{align}As the voltage across the capacitor increases, according to Equation (6.1.25), the voltage across the resistor, \(v_{AB}\text{,}\) decreases. This results in an exponentially decreasing build up of voltage across the capacitor. When it finally equals the voltage of the battery, the voltage across the resistor is \(0.0\) volts and current flow in the circuit becomes zero. The rate of the exponential decrease is given by the product \(RC\text{,}\) called the *time constant*.

Using the values of R and C in Figure 6.1.4 we get

\begin{align} R\ C &= 1.0 \times 10^3 \ \mathrm{ohms} \times 1.0 \times 10^{-6}\ \mathrm{farads}\tag{6.1.29}\\ &= 1.0 \times 10^{-3}\ \mathrm{seconds}\tag{6.1.30}\\ &= 1.0\ \mathrm{msec.}\tag{6.1.31} \end{align}Thus, assuming the capacitor in Figure 6.1.4 has \(0.0\) volts across it when the switch is closed, the voltage that develops over time is given by

\begin{gather} v_{BC} = 2.5\ (1 - \mathrm{e}^{\small -t / 10^{-3}})\tag{6.1.32} \end{gather}This is shown in Figure 6.1.5.

At the time \(t = 1.0\) millisecond (one time constant), the voltage across the capacitor is

\begin{align} v_{BC} &= 2.5\ (1 - \mathrm{e}^{\small -10^{-3} / 10^{-3}})\tag{6.1.33}\\ &= 2.5\ (1 - \mathrm{e}^{\small -1})\tag{6.1.34}\\ &= 2.5 \times 0.63\tag{6.1.35}\\ &= 1.58\ \mathrm{volts}\tag{6.1.36} \end{align}After 6 time constants of time have passed, the voltage across the capacitor has reached

\begin{align} v_{BC} &= 2.5\ (1 - \mathrm{e}^{\small -6 \times 10^{-3} / 10^{-3}})\tag{6.1.37}\\ &= 2.5\ (1 - \mathrm{e}^{\small -6})\tag{6.1.38}\\ &= 2.5 \times 0.9975\tag{6.1.39}\\ &= 2.49\ \mathrm{volts}\tag{6.1.40} \end{align}At this time the voltage across the resistor is essentially \(0.0\) volts and current flow is very low.

*Inductors* are not used in logic circuits. In the typical PC, they are found as part of the CPU power supply circuitry. If you have access to the inside of a PC, you can probably see a small (about 1 cm. in diameter) donut-shaped device with wire wrapped around it on the motherboard near the CPU. This is an inductor used to smooth the power supplied to the CPU.

An inductor stores energy in the form of a magnetic field. It reacts slowly to current changes, requiring time for the magnetic field to build. The relationship between voltage at time \(t\) across an inductor and current flow through it is given by the equation

\begin{gather} v = L\ \frac{\mathrm{d}i}{\mathrm{d}t}\tag{6.1.41} \end{gather}where L is the value of the inductor in henrys.

Figure 6.1.6 shows a \(1.0\) microhenry inductor connected in series with a \(1.0\) kilohm resistor.

When the switch is open no current flows through this circuit. Upon closing the switch, the inductor initially impedes the flow of current, taking time for a magnetic field to be built up in the inductor.

At this initial point no current is flowing through the resistor, so the voltage across it, \(v_{BC}\text{,}\) is \(0.0\) volts. The full voltage of the battery, \(2.5\) volts, appears across the inductor, \(v_{AB}\text{.}\) As current begins to flow through the inductor the voltage across the resistor, \(v_{BC}\text{,}\) grows. This results in an exponentially decreasing voltage across the inductor. When it finally reaches \(0.0\) volts, the voltage across the resistor is \(2.5\) volts and current flow in the circuit is \(2.5\) ma.

The rate of the exponential voltage decrease is given by the time constant \(L / R\text{.}\) Using the values of \(R\) and \(L\) in Figure 6.1.6 we get

\begin{align} \frac{L}{R} &= \frac{1.0 \times 10^{-6}\ \mathrm{henrys}}{1.0 \times 10^3\ \mathrm{ohms}}\tag{6.1.42}\\ &= 1.0 \times 10^{-9}\ \mathrm{seconds}\tag{6.1.43}\\ &= 1.0 \mathrm{nanoseconds}\tag{6.1.44} \end{align}When the switch is closed, the voltage that develops across the inductor over time is given by

\begin{equation} v_{AB} = 2.5 \times \mathrm{e}^{\small -t / 10^{-9}}\tag{6.1.45} \end{equation}This is shown in Figure 6.1.7.

Note that after about \(6\) nanoseconds (\(6\) time constants) the voltage across the inductor is essentially equal to \(0.0\) volts. At this time the full voltage of the battery is across the resistor and a steady current of \(2.5\) ma flows.

This circuit in Figure 6.1.6 illustrates how inductors are used in a CPU power supply. The battery in this circuit represents the computer power supply, and the resistor represents the load provided by the CPU. The voltage produced by a power supply includes noise, which consists of small, high-frequency fluctuations added to the DC level. As can be seen in Figure 6.1.7, the voltage supplied to the CPU, \(v_{BC}\text{,}\) changes little over short periods of time.