Electronics — Revision Notes
1. Why some solids conduct and others do not: energy bands
When single atoms join to form a solid, their electron energy levels split and overlap. They form continuous ranges of energy called energy bands. No two electrons can share the same quantum state, so the separate levels of the single atoms must spread out into bands.
There are three bands to know:
- Valence band — the range of energy levels filled by electrons that are bound to atoms and take part in chemical bonding. It is the highest band that holds electrons under normal conditions.
- Forbidden band (energy gap) — the range of energy levels between the valence band and the conduction band, where no electron states exist. A larger gap means the material conducts less well.
- Conduction band — the range of energy levels where electrons are free to move through the material. Electrons here are not bound to any one atom, so they can carry electric current.
In a diamond crystal, carbon atoms (1s² 2s² 2p²) form two main bands. The valence band holds the lower energy states and the conduction band holds the higher ones. The gap between them stops electrons in the valence band from moving easily into the conduction band.
Solids are sorted into three groups by their energy bands:
| Group | Energy gap | How it conducts |
| Conductors | No gap between the valence band and the conduction band | Electrons flow easily from one band to the other under an electric field, so they conduct well |
| Semiconductors | Very small gap | With enough energy, electrons jump from the valence band to the conduction band; conductivity rises as temperature rises |
| Insulators | Very large gap | They do not conduct electricity, even when a large amount of energy is supplied; examples are wood and plastics |
Two more facts about conduction: resistivity is the resistance per unit length and cross-sectional area of a material, measured in ohm-metre (Ω·m). Conductivity is a measure of how well a material conducts, and it depends on how many charge carriers are available and how easily they move. In a conductor, a rise in temperature makes electron collisions faster, so resistance rises. The number of charge carriers per unit volume, n, is measured in m⁻³ and can be found from the Hall effect.
2. Intrinsic and extrinsic semiconductors
A semiconductor is a material whose conductivity sits between a conductor and an insulator. The two most used semiconductors are silicon (Si) and germanium (Ge). Both have a crystal structure, and both are group IV elements.
- Intrinsic (pure) semiconductors are chemically pure. They hold no large amount of impurity atoms. Their conductivity is moderate.
- Extrinsic (doped) semiconductors are made by adding a small number of impurity atoms to a pure semiconductor. This process is called doping, and it changes the electrical properties a lot. Doping is what makes semiconductors useful in modern electronic devices such as transistors, diodes, integrated circuits and microprocessors.
Solid-state electronics is the branch of electronics that deals with the flow of electric current through solid materials such as semiconductors, insulators and conductors. It covers the design and use of electronic devices and circuits that control electrical energy. The first solid-state device was the cat-whisker detector: in 1874 the German physicist Ferdinand Braun found that touching a thin wire (the "whisker") to a crystal of galena (lead sulfide) could detect radio waves. That discovery led to crystal detectors in early radios, and then to diodes and transistors.
3. N-type and P-type semiconductors
Doping uses two kinds of impurity, and each makes a different kind of semiconductor.
N-type semiconductors are made by doping with a donor impurity: a group V (penta-valent) element such as phosphorus (P), arsenic (As) or antimony (Sb). The impurity atom has one more valence electron than the semiconductor atoms. That extra electron is free to move and conduct electricity. So an N-type semiconductor has an excess of negatively charged carriers — electrons — and electrons are its majority carriers.
P-type semiconductors are made by doping with an acceptor impurity: a group III (tri-valent) element such as boron (B) or gallium (Ga). The impurity atom has one fewer valence electron than the semiconductor atoms. That missing electron leaves a hole — an empty place in the crystal lattice where an electron is missing from a covalent bond. So a P-type semiconductor has an excess of positively charged carriers — holes — and holes are its majority carriers.
| Feature | N-type | P-type |
| Dopant | Group V element (P, As, Sb) — a donor | Group III element (B, Ga) — an acceptor |
| Extra carrier | Free electron | Hole |
| Majority carriers | Electrons (negative) | Holes (positive) |
| Minority carriers | Holes | Electrons |
At normal working temperatures, heat energy is enough to ionise the acceptor atoms, so the holes they create can move freely in the valence band and carry current.
4. Electrons and holes in a semiconductor
When the temperature rises, some valence electrons gain enough energy to cross the small energy gap into the conduction band and become free electrons. Each electron that leaves creates a hole in the valence band. Equal numbers of holes and electrons are made. This is called electron-hole pair production.
Under an electric field, the two kinds of carrier move in opposite directions: conduction electrons move towards the anode (positive side) and holes move towards the cathode (negative side). So the current in a semiconductor is the flow of electrons in the conduction band and holes in the valence band, in opposite directions.
The size of the energy gap decides how easily this happens. The gap is 0.72 eV for germanium and 1.1 eV for silicon.
5. The P-N junction and the depletion layer (PMDC 13.2)
A P-N junction is formed when a P-type and an N-type semiconductor are joined. It is made inside a single crystal of material, not by simply joining two separate pieces. The P side is the anode and the N side is the cathode. The junction is the basis of diodes and transistors.
As soon as the junction forms, carriers diffuse across it: electrons move from the N-type to the P-type, leaving negative ions behind, and holes move from the P-type to the N-type, leaving positive ions behind. This goes on until balance is reached. The ions left near the junction form a potential barrier and a depletion layer — a thin region around the junction that holds no free charge carriers. The depletion layer stops further movement across the junction.
The depletion layer has three clear features: reduced carrier concentration, increased resistance and decreased conductivity. It acts as a barrier that controls the flow of current.
6. The diode: forward bias and reverse bias (PMDC 13.2)
A diode is a semiconductor device made from a P-N junction. It lets electric current flow in one direction and blocks it in the opposite direction. Its symbol is a triangle (the anode) pointing towards a bar (the cathode). A diode can rectify current, it creates a potential barrier, and it has a non-linear current-voltage characteristic.
Forward bias means the P-type is connected to the positive terminal of the battery and the N-type to the negative terminal. The applied electric field points against the built-in field of the junction, so the total field is smaller. The depletion region becomes thinner and less resistant, and current can flow. In silicon, current starts to flow when the applied voltage reaches about 0.7 V; in germanium, about 0.3 V.
Reverse bias means the P-type is connected to the negative terminal and the N-type to the positive terminal. Now the applied field points the same way as the built-in field, so the total field is larger. The depletion region becomes thicker and more resistant, and almost no current flows. Raising the voltage makes the depletion region thicker still.
| Bias | Connections | Depletion layer | Current |
| Forward bias | P to +, N to − | Becomes thinner, less resistant | Flows freely once the barrier voltage is passed (about 0.7 V for silicon, 0.3 V for germanium) |
| Reverse bias | P to −, N to + | Becomes thicker, more resistant | Almost none — only a tiny leakage current |
7. I-V characteristics of the P-N junction
The I-V (current-voltage) characteristic is the graph of the current through a diode against the voltage across it. There are three cases:
- Zero bias (unbiased): no external voltage is applied, so no current flows.
- Forward bias: current starts when the diode voltage reaches 0.7 V for silicon and 0.3 V for germanium. At first the current rises slowly, making a non-linear curve. Once the diode passes the potential barrier, the curve steepens and current rises quickly with voltage.
- Reverse bias: only a small leakage current flows. It stays low until the diode reaches breakdown, when the current rises sharply. At breakdown the diode can be destroyed unless a high series resistance limits the current.
8. Rectification: half-wave and full-wave (PMDC 13.1)
Rectification is the process of changing an alternating current (AC) waveform into a direct current (DC) waveform — a waveform with only one polarity. A diode can do this because it conducts in forward bias and blocks in reverse bias. There are two kinds of rectifier.
Half-wave rectification uses one diode. During the positive half-cycle of the AC supply, the diode is forward biased: it acts like a closed switch and current flows through the load resistor R. During the negative half-cycle, the diode is reverse biased: it acts like an open switch and no output is produced. The output is only the positive half-cycles, so it is unidirectional. Half-wave rectifiers are used in low-power battery chargers, fire alarm circuits, soldering iron circuits and as detectors in AM radio circuits.
Full-wave rectification uses two diodes and a centre-tapped transformer. During the positive half-cycle, diode D₁ is forward biased (closed switch) and diode D₂ is reverse biased (open switch), so current flows through the load. During the negative half-cycle, D₂ is forward biased and D₁ is reverse biased, so current flows through D₂ and the load. The current through the load flows in the same direction in both half-cycles, so a DC output is obtained across the load. Full-wave rectifiers are used in mobile phone and laptop chargers, uninterruptible power supply (UPS) circuits, home inverters and LCD and LED TVs.
| Feature | Half-wave rectifier | Full-wave rectifier |
| Diodes used | One | Two (with a centre-tapped transformer) |
| Output | Only the positive half-cycles | Both half-cycles, all in the same direction |
| Uses | Battery chargers, fire alarms, soldering irons, AM radio detectors | Phone and laptop chargers, UPS, home inverters, LCD/LED TVs |
9. LED, photodiode and photovoltaic cell
Light-emitting diode (LED): an LED is a special P-N junction that gives out light when current flows through it in the forward direction. Electrons move from the negative side to the positive side and combine with holes. Each combination gives out a photon whose energy is close to the material's band gap. Silicon diodes do not work well for LEDs, so compounds such as gallium arsenide (GaAs) are used. Gallium arsenide has a 1.42 eV energy gap and gives near-infrared photons of 870 nm wavelength, which is why it is used in infrared LEDs in remote controls for TVs, DVD players and car door locks. LED bulbs are used in flashlights, streetlights, traffic signals, car brake lights, billboards and LCD screens. They last about 50,000 hours, against about 2,000 hours for a normal bulb, and they are more efficient and more durable.
Photodiode: a photodiode is a light detector that changes light into current or voltage. It has optical filters, built-in lenses and a surface that catches light. It is often used in reverse bias, where the voltage helps the photocurrent to flow and makes the detector most sensitive. Photodiodes are usually made of silicon. When photons hit the semiconductor, they give their energy to electrons and make electron-hole pairs. This makes a current that is proportional to the brightness of the light: brighter light gives a higher current. Photodiodes are used in optical communication and fibre optics, in light sensors such as cameras, light meters and automatic lighting, in barcode readers, and in medical devices such as pulse oximeters that measure oxygen levels in blood. Other uses named in the book are CAT scanners, X-ray detection, blood particle analysis, headlight dimmers, twilight detectors, light pens, encoders, surveying instruments and copiers.
Photovoltaic cell (solar cell): a solar cell is a heavily doped P-N junction diode that changes sunlight into electric energy. If the energy of a photon is greater than the band gap, it makes an electron-hole pair: the photon lifts an electron from the valence band, and the electron flows through an external circuit. The cell then works as a source of emf and power. A cell is built in layers: glass, anti-reflective coating, metal contacts, N-doped silicon, the P-N junction, P-doped silicon and a metal backing. Silicon is the usual material because it is widely available; cadmium telluride and copper indium gallium selenide are also used. A typical silicon P-N junction gives about 0.6 V. Many cells are joined in series to give a higher voltage, and series strings are joined in parallel in a solar panel. A good panel can give about 50 W/m² on average, over day and night, sunny and cloudy weather.
10. Transistors: N-P-N and P-N-P
A transistor is a semiconductor device that amplifies or switches electronic signals. It controls the flow of current between its three layers: the base, the collector and the emitter. It works like a gatekeeper: the voltage at the base decides whether current can flow between the collector and the emitter. The bipolar junction transistor was invented in 1948 by J. Bardeen, W. Shockley and W. Brattain. It is a crystal of one type of doped semiconductor sandwiched between two layers of the opposite type.
There are two kinds:
- N-P-N transistor: a thin P-type layer between two N-type layers. The majority carriers are electrons. In normal operation, current flows from the emitter to the collector.
- P-N-P transistor: a thin N-type layer between two P-type layers. The majority carriers are holes. In normal operation, current flows from the collector to the emitter.
The arrow is always drawn on the emitter. It shows the direction of current flow in normal operation: out of the emitter in an N-P-N transistor, and into the emitter in a P-N-P transistor.
| Feature | N-P-N | P-N-P |
| Structure | N–P–N (two N-type layers) | P–N–P (two P-type layers) |
| Majority carriers | Electrons | Holes |
| Minority carriers | Holes | Electrons |
| Current direction (normal operation) | Emitter to collector | Collector to emitter |
| Switched on when | Electrons enter the base | Holes enter the base |
11. How a transistor works: the current equations
For a transistor to work as an amplifier, two conditions must hold (shown here for an N-P-N transistor):
- The base-emitter junction is forward biased, so a base current I_B flows. Once this junction is conducting, the base-emitter voltage V_BE is about 0.6 V.
- The base-collector junction is reverse biased.
The transistor action is the injection of minority carriers (electrons in an N-P-N, holes in a P-N-P) from the emitter into the thin base. That small flow controls the much larger flow of majority carriers from the collector to the emitter.
The currents follow three equations:
- I_C = β I_B — the collector current equals the current gain β times the base current. β is typically about 100, and usually lies between 20 and 200.
- I_E = I_B + I_C = (1 + β) I_B — the emitter current is the sum of the base and collector currents.
- α = I_C / I_E and β = I_C / I_B, so I_C = α I_E = β I_B, with α = β / (β + 1) and β = α / (1 − α). Alpha is always less than one.
A small change in the base current makes a much larger change in the collector current. With β = 100, one electron flows from the base for every 100 electrons flowing between the emitter and the collector. That is how a transistor amplifies: a small current at the base controls a large current in the collector-emitter circuit.
Worked example from the book: a transistor has I_B = 240 µA, I_E = 12 mA and β = 49. Then α = β / (β + 1) = 49 / 50 = 0.98. The collector current is I_C = α × I_E = 0.98 × 12 mA = 11.76 mA, which agrees with I_C = β × I_B = 49 × 240 µA = 11.76 mA.
Worked example from the book: in a common-base connection, I_C = 0.95 mA and I_B = 0.05 mA. Then I_E = I_B + I_C = 1 mA, and α = I_C / I_E = 0.95 / 1 = 0.95.
12. The three regions: active, saturation and cut-off
The graph of collector current I_C against collector-emitter voltage V_CE, drawn for different values of base current I_B, shows three regions:
- Active region: the transistor amplifies. A small base current gives a larger collector current, and I_C = β I_B. On the graph this is the flat part: further rises in base current raise I_C, but I_C hardly changes with V_CE. Proper biasing keeps the transistor in the active region for linear amplification.
- Saturation region: at low V_CE, I_C rises sharply and then stops rising. The transistor is fully ON, giving maximum collector current. It acts almost like a short circuit between the collector and the emitter, with I_C = I_E.
- Cut-off region: when the conditions for transistor action are not met — for example when I_B = 0 — the transistor is OFF. Then I_C = 0 and I_E = 0, and the transistor acts like an open circuit between the collector and the emitter.
Biasing means applying external voltages to a transistor to set a working point where it amplifies or switches properly. The four biasing methods in the book are:
| Method | How it works | Stability |
| Fixed bias (base bias) | A resistor joins the base to the power supply and sets a fixed voltage at the base | Simple, but not very stable |
| Emitter bias (emitter stabilised bias) | A resistor joins the emitter to the power supply and steadies the working point | More stable than fixed bias |
| Collector feedback bias | Combines fixed bias and emitter bias, with a resistor network giving feedback | Improved stability |
| Voltage divider bias | A resistor divider network biases the base | More stable than fixed bias, less stable than emitter bias |
13. Transistor as a switch
A transistor can work as a switch: it either lets current flow or blocks it. In the book's example, an N-P-N transistor Q₁ controls a lamp. The control circuit has a 3 V battery, a switch S₁ and a resistor R₁ joined to the base. The power circuit has a 9 V battery and the lamp in the collector line. The emitter is common to both circuits.
- Switch S₁ open: no forward voltage reaches the base-emitter junction, so no base current flows. The resistance from emitter to collector is very high, no current flows in the power circuit, and the lamp stays off.
- Switch S₁ closed: a small base current flows (R₁ limits it). The resistance from emitter to collector falls, a large collector current flows in the power circuit, and the lamp lights up. Opening S₁ again turns the lamp off, because the emitter-collector resistance rises again, almost to infinity.
14. Transistor as an amplifier: the common-emitter circuit
A transistor is a three-terminal device, and there are three ways to connect it in a circuit, with one terminal common to the input and the output signals. The most used is the common-emitter connection.
In the book's common-emitter amplifier, the load resistance R_L is joined in series with the collector. The circuit is biased so that the transistor is partly turned on: with a 10 V supply, the base sits at +0.71 V and the collector at +5 V — half the supply voltage — while the emitter is at 0 V. The amount of DC forward bias sets the working level of the transistor.
When a small input signal is added — 0.02 V peak-to-peak in the book's example, coupled to the base through a capacitor — a larger signal appears at the collector: 3 V peak-to-peak. The voltage gain is A_v = V_out / V_in = 3 / 0.02 = 150. The output is 150 times the input, so the stage is said to have a voltage gain of 150.
The common-emitter circuit has greater input impedance and greater current and power gain than the common-base circuit, but its voltage gain is much lower. It is an inverting amplifier: the output signal is shifted 180° in phase from the input signal.
15. Common-base and common-collector circuits
Common-base (CB) circuit: the input and output signals share the base terminal. The input signal is applied to the emitter and the output is taken from the collector, with the base-emitter junction forward biased. The current gain is I_C / I_E = α, which is less than one. Because the base current is extremely small compared with the collector current, the emitter current is almost equal to the collector current (I_E ≈ I_C). The CB circuit has a low input impedance. It is used less often than the common-emitter and common-collector circuits, in places where a low input impedance is an advantage.
Common-collector (CC) circuit: the input signal is applied to the base and the output signal is taken from the emitter, with the collector terminal common to both. When the base-emitter junction is forward biased, a small base current makes a much larger collector current flow, and I_E ≈ I_C because I_B is much smaller than I_C. The CC circuit has a high current gain, a high input impedance and a low output impedance, and its voltage gain is about one. It is used for impedance matching and in signal buffering circuits, where a high-resistance input must drive a low-resistance output load.
| Configuration | Input to | Output from | Current gain | Input impedance | Main use |
| Common-emitter (CE) | Base | Collector | β (about 100) | Higher than CB | Voltage and current amplification; output inverted by 180° |
| Common-base (CB) | Emitter | Collector | α (less than 1) | Low | Special uses needing low input impedance |
| Common-collector (CC) | Base | Emitter | High | High | Impedance matching, buffering; voltage gain about 1 |
16. The operational amplifier
An operational amplifier (op-amp) is a direct-coupled, high-gain amplifier. It is an integrated circuit that can work with both AC and DC signals. It can perform linear, non-linear and mathematical operations, such as adding, subtracting, integration and differentiation. Op-amps are ideal for DC amplification and are used in signal conditioning and filtering.
The op-amp symbol is a triangle with two inputs and one output. The + input is the non-inverting input and the − input is the inverting input. The op-amp also has V+ and V− power supply terminals.
An ideal op-amp has these properties:
| Property | Ideal value | What it means |
| Open-loop voltage gain | Infinite | Even a tiny input difference gives a huge output |
| Input resistance (impedance) | Infinite | It draws no current from the circuit it measures, so it does not load it |
| Output resistance (impedance) | Zero | All the output voltage reaches the load |
| Gain against frequency | Independent of frequency | Amplification stays the same at all frequencies |
| Bandwidth | Infinite | It amplifies all frequencies equally |
| Slew rate | Infinite | The output changes instantly when the input changes — no time delay |
| Noise contribution | Zero | It adds no noise of its own (it still amplifies any noise in the input) |
17. Op-amp as a comparator
With no feedback, the output voltage of an op-amp is V_out = G_o × (V⁺ − V⁻), where G_o is the open-loop voltage gain and the voltages are measured from the zero-volt (earth) line. Suppose G_o = 10⁵, V⁺ = 0.15 V and V⁻ = 0.10 V. Then V_out = 10⁵ × (0.15 − 0.10) = 5000 V. That is impossible: the op-amp saturates, and its output sits close to one of the power supply voltages — here +9 V, because V⁺ is bigger than V⁻.
So the op-amp works as a comparator, comparing V⁺ and V⁻:
- If V⁺ is slightly greater than V⁻, V_out equals the positive supply voltage.
- If V⁺ is slightly smaller than V⁻, V_out equals the negative supply voltage.
Even a small difference between the two inputs tells you which one is larger.
18. Negative feedback
Negative feedback happens when a part of the output signal is fed back to the input in a way that opposes, or subtracts from, the input signal. It lowers the gain, but it brings five advantages:
- Reduced gain — the overall gain of the system falls.
- Decreased distortion and noise — the output signal is cleaner.
- Improved stability — the gain is steadier and less sensitive to outside changes such as temperature.
- Increased bandwidth — the range of frequencies the system handles grows.
- Better impedance — the output impedance falls and the input impedance rises.
In a voltage follower, the input is joined to the non-inverting (+) input and the output is fed back to the inverting (−) input. With a very high open-loop gain, V⁻ equals V⁺, so the closed-loop gain G = V_out / V_in = G_o / (1 + G_o) is very nearly 1 (when G_o is about 10⁵). This holds as long as the output voltage stays smaller than the supply voltage — for example between −6 V and +6 V with ±6 V supplies. A piezo-electric microphone, which has a high internal resistance, can be joined to such an op-amp to raise its current output while keeping the same voltage.
19. Inverting and non-inverting amplifiers
Inverting amplifier: the input signal goes through a resistor R₁ to the inverting (−) input, and a feedback resistor R₂ joins the output back to the (−) input. The op-amp forces the (−) terminal to the same voltage as the (+) terminal, which is earthed — so the (−) input sits at virtual earth (see section 20). The input current is V_IN / R₁, and the same current flows through R₂ to the output, because ideally no current flows into the op-amp. The output voltage is:
V_out = −(R₂ / R₁) × V_in
The minus sign means a positive input gives a negative output. For an AC input, the output is shifted 180° from the input. The output can only swing between the positive and negative supplies, so a negative output voltage needs a negative supply rail. With R₁ = 1 kΩ and R₂ = 10 kΩ, the gain is −10.
Non-inverting amplifier: the input signal is joined to the non-inverting (+) terminal. The op-amp forces the (−) terminal to the same voltage as the input, and that makes a current flow through the feedback resistors. The output is always in phase with the input, and the gain is always greater than 1:
V_out = (1 + R₂ / R₁) × V_in
20. The virtual earth approximation
To understand the inverting amplifier, you need the virtual earth approximation. In this approximation, the potential at the inverting input (−) is very close to 0 V. There are two steps to the argument:
- The op-amp multiplies the difference between its inputs, V_out = G_o × (V⁺ − V⁻). Because the open-loop gain G_o is very high, the difference between V⁺ and V⁻ must be almost zero.
- The non-inverting input (+) is joined to the zero-volt line, so V⁺ = 0. That means V⁻ must also be close to zero, so the inverting input (−) sits almost at earth potential.
The point is called a virtual earth: it is not actually 0 V, but it is very close to 0 V. The approximation holds as long as the op-amp is not saturated, and at frequencies where the open-loop voltage gain is still high. It is used in summing amplifier circuits, where several input voltages are added together through resistors joined to the inverting input, and it makes the currents and voltages in the circuit easy to work out.
Using the virtual earth idea, the gain of the inverting amplifier is easy to find. If the current in the input resistor R_in is I_in and the current in the feedback resistor R_f is I_f, with point P at 0 V: I_in = V_in / R_in and I_f = V_out / R_f. The input resistance of the op-amp is very high, so almost no current enters the (−) input, and I_in and I_f must be equal in size. If V_in is positive, the current in the two resistors flows from left to right, so V_out must be negative — the current flows from P (at 0 V) to the output, which must sit below 0 V. So I_f = −I_in, V_out / R_f = −V_in / R_in, and the gain is G = V_out / V_in = −R_f / R_in.
21. Digital electronics: signal levels
Digital electronics deals with digital signals, shown as binary digits (0s and 1s). Analog electronics uses continuous signals, but digital electronics processes discrete signals, which allows precise control and storage of information. Digital circuits are the basis of modern computing, communication and information processing.
In digital electronics, a signal has two levels:
- Low level (0): the binary digit 0, a lower voltage (for example 0 volts). It is called "low" or "logic 0".
- High level (1): the binary digit 1, a higher voltage (for example +5 volts). It is called "high" or "logic 1".
Three more ideas complete the picture:
- Threshold level: the voltage that separates the low and high states. Signals below it are read as 0, and signals above it are read as 1. It sets the noise margin and makes the reading reliable.
- Logic levels: different technologies and systems may use different voltage levels for high and low.
- Swing (voltage range): the difference in voltage between the low and high states. For example, a signal that varies from −5 V to +5 V has a swing of 10 V. A larger swing gives better noise immunity and more reliable signals.
Noise immunity is a measure of how well a logic circuit can stand unwanted electrical signals, or noise, without reacting to them. The 'high' and 'low' states are often written as '1' and '0': '1' means a closed circuit, or a voltage near the maximum — the 'on' or 'active' state — and '0' means an open circuit, or a voltage near the minimum — the 'off' or 'inactive' state. A digital waveform is a train of pulses that switches back and forth between HIGH and LOW. The '1' and '0' states are the basic building blocks for coding and processing binary data, and the algebra that describes them is called Boolean algebra.
The first remote-control device was built by Nikola Tesla in 1898: a radio-controlled miniature boat, worked by "teleautomation". Its control system decoded radio (Hertzian) waves and switched actions on and off — working like an AND gate.
22. Logic gates
Logic gates are tiny electronic switches that make decisions in computers and other devices. They combine to perform logical operations and play a key role in information processing. A gate has one output and more than one input. AND, OR and NOT are the basic gates. NAND and NOR are the universal gates, because any other logic gate can be built from them. XOR and XNOR are the special gates.
22.1 AND gate
The AND gate gives a 'high' output only when all its inputs are 'high'. In other words, the output is 1 if and only if all the inputs are 1.
- Two inputs: Y = A.B
- Three inputs: Y = A.B.C
- Four inputs: Y = A.B.C.D
For three or four inputs, the rule is the same: Y = 1 only when every input is 1.
22.2 OR gate
The OR gate gives a 'high' output if any of its inputs is 'high'. The output is 1 if one or more inputs are 1.
- Two inputs: Y = A + B
- Three inputs: Y = A + B + C
- Four inputs: Y = A + B + C + D
For three or four inputs, the rule is the same: Y = 0 only when every input is 0.
22.3 NOT gate
The NOT gate performs inversion: it flips its single input. The output is 1 if and only if the input is not 1. Its Boolean expression is Y = Ā, read as "Y equals NOT A".
22.4 NAND gate
A NAND gate is an AND gate followed by a NOT gate, so it gives the opposite output of an AND gate.
- Two inputs: Y = overline(A.B)
- Three inputs: Y = overline(A.B.C)
- Four inputs: Y = overline(A.B.C.D)
Y = 0 only when every input is 1.
22.5 NOR gate
A NOR gate is an OR gate followed by a NOT gate, so it gives the opposite output of an OR gate.
- Two inputs: Y = overline(A + B)
- Three inputs: Y = overline(A + B + C)
- Four inputs: Y = overline(A + B + C + D)
Y = 1 only when every input is 0.
22.6 XOR gate (exclusive-OR)
The XOR gate gives a 'high' output when the number of 'high' inputs is odd. For two inputs, the output is 1 when one and only one input is 1.
- Two inputs: Y = A.B̄ + Ā.B
- Three inputs: Y = A.B̄.C̄ + Ā.B.C̄ + Ā.B̄.C + A.B.C
- Four inputs: Y = A ⊕ B ⊕ C ⊕ D
22.7 XNOR gate (exclusive-NOR)
The XNOR gate is an XOR gate followed by a NOT gate. Its output is 1 when both inputs are the same — both 0 or both 1. In general, it gives a high output when an even number of its inputs are high.
- Two inputs: Y = NOT(A ⊕ B) = A.B + Ā.B̄
23. AND and OR gates with switches and a lamp
The behaviour of AND and OR gates can be shown with a simple circuit made of two switches, a lamp and a battery. An open switch stands for logic 0 and a closed switch stands for logic 1. A lit lamp stands for logic 1 and an unlit lamp for logic 0.
- AND gate — switches in series: the lamp lights up only when both switch A and switch B are ON. If either switch, or both, is OFF, the lamp stays off. The lamp is on only when the circuit is closed, which needs both switches closed.
- OR gate — switches in parallel: the lamp lights up if either switch A or switch B, or both, is ON. The lamp stays off only when both switches are OFF.
| Circuit | Lamp ON when | Lamp OFF when |
| AND (switches in series) | Both A and B are ON | Either switch (or both) is OFF |
| OR (switches in parallel) | Either A or B (or both) is ON | Both A and B are OFF |
Start the test: Set 1 ↓