- Authors

- Name
- Youngju Kim
- @fjvbn20031
Electronic Circuits Complete Guide: From Diodes to Op-Amps
Analog electronic circuits are at the heart of electrical engineering. This guide systematically covers circuit theory fundamentals, semiconductor devices, amplifier design, filters, and power supplies — all with practical examples and simulation code.
1. Circuit Theory Fundamentals
Kirchhoff's Laws
Kirchhoff's Voltage Law (KVL): The algebraic sum of all voltages around any closed loop is zero.
Kirchhoff's Current Law (KCL): The algebraic sum of all currents entering/leaving any node is zero.
import numpy as np
# Node voltage analysis using KCL
# Circuit: V1=12V, R1=1kOhm, R2=2kOhm, R3=3kOhm
# Conductance matrix (G) and current source vector (I)
G = np.array([
[1/1e3 + 1/2e3, -1/2e3],
[-1/2e3, 1/2e3 + 1/3e3]
])
I = np.array([12/1e3, 0])
V = np.linalg.solve(G, I)
print(f"Node voltages: V1={V[0]:.3f}V, V2={V[1]:.3f}V")
Thevenin and Norton Equivalent Circuits
Any linear circuit can be simplified into a Thevenin equivalent: a voltage source in series with a resistance . The Norton equivalent uses a current source in parallel with .
Maximum Power Transfer Theorem: Maximum power is delivered to a load when .
Superposition Principle
In a linear circuit with multiple independent sources, the response (voltage or current) at any element is the sum of responses due to each source acting alone (with all other sources replaced by their internal impedances).
AC Circuits and Phasor Analysis
Impedance representations:
- Resistor:
- Inductor:
- Capacitor:
The transfer function and Bode plots are essential tools for frequency response analysis. The magnitude response in dB is .
2. Diodes
Physics of the p-n Junction
When p-type semiconductor (majority carriers: holes) and n-type semiconductor (majority carriers: electrons) are joined, a depletion region forms at the junction. Under forward bias the depletion region narrows and current flows; under reverse bias the depletion region widens and current is blocked (except for a small reverse saturation current).
The built-in potential across the junction is typically 0.6–0.7 V for silicon at room temperature.
Shockley Diode Equation
where:
- : reverse saturation current (~ A for silicon)
- : ideality factor (ideal: 1, practical: 1–2)
- : thermal voltage (~26 mV at 25°C)
import numpy as np
import matplotlib.pyplot as plt
# Diode I-V characteristic
V = np.linspace(-0.5, 0.8, 1000)
IS = 1e-14 # Reverse saturation current
n = 1.0 # Ideality factor
VT = 0.02585 # Thermal voltage at 25 degC
ID = IS * (np.exp(V / (n * VT)) - 1)
ID_clipped = np.clip(ID, -1e-12, 0.1)
plt.figure(figsize=(8, 5))
plt.plot(V, ID_clipped * 1000, 'b-', linewidth=2)
plt.axhline(y=0, color='k', linewidth=0.5)
plt.axvline(x=0, color='k', linewidth=0.5)
plt.xlabel('Diode Voltage V_D (V)')
plt.ylabel('Diode Current I_D (mA)')
plt.title('Diode I-V Characteristic Curve')
plt.grid(True, alpha=0.3)
plt.xlim(-0.5, 0.8)
plt.ylim(-0.01, 0.1)
plt.show()
Rectifier Circuits
Half-wave rectifier: One diode passes only the positive half cycle. Average output voltage .
Full-wave bridge rectifier: Four diodes conduct on both half cycles. Average output voltage . The ripple frequency is twice the input frequency.
A smoothing capacitor reduces ripple voltage: .
Zener Diode
Operates in reverse breakdown at a well-defined Zener voltage . Used as a simple voltage reference or clamp.
Special Diodes
- LED (Light-Emitting Diode): Emits photons during forward conduction. Forward voltage typically 1.8–3.5 V depending on material.
- Photodiode: Generates current proportional to incident light; operated in reverse bias (photoconductive mode).
- Schottky Diode: Metal-semiconductor junction; very low forward voltage (~0.3 V) and fast switching.
3. BJT Transistors
Structure and Operating Modes
The BJT (Bipolar Junction Transistor) has three terminals: Emitter (E), Base (B), and Collector (C).
| Operating Mode | B-E Junction | B-C Junction | Application |
|---|---|---|---|
| Cutoff | Reverse | Reverse | Switch OFF |
| Active | Forward | Reverse | Amplifier |
| Saturation | Forward | Forward | Switch ON |
In the active region: , where is the DC current gain (typically 50–300).
Also:
DC Bias Design
The most stable bias configuration is the voltage divider bias:
The stability factor (where ) determines how well the Q-point resists temperature-induced changes in .
Small-Signal Hybrid-Pi Model
Key parameters derived at the Q-point:
- : transconductance
- : input resistance (base to emitter, small signal)
- : output resistance (Early effect, = Early voltage)
Amplifier Configuration Comparison
| Config | Voltage Gain | Current Gain | Input Z | Output Z | Use Case |
|---|---|---|---|---|---|
| CE | High (inverting) | High | Medium | Medium | General amplification |
| CC (Emitter Follower) | ~1 | High | High | Low | Buffer, impedance matching |
| CB | High | ~1 | Low | High | High-frequency, RF |
Common-emitter voltage gain (with bypass capacitor on ):
where .
4. MOSFET
Device Physics and Operating Regions
The MOSFET (Metal-Oxide-Semiconductor FET) has four terminals: Gate (G), Drain (D), Source (S), and Body (B). For an n-channel NMOS device:
Cutoff region: →
Linear (Ohmic) region: and
Saturation region:
The parameter is the process transconductance parameter.
Small-Signal Parameters
At a given bias point:
- : output resistance from channel-length modulation
CMOS Inverter
The complementary MOSFET (CMOS) inverter pairs one PMOS and one NMOS transistor. During static operation, one transistor is always off, giving near-zero static power dissipation. This makes CMOS the dominant technology for digital logic.
Switching energy per transition:
MOSFET Current Mirrors
Used for biasing in analog ICs. A basic current mirror forces the output current to mirror the reference current, assuming matched devices. The Wilson and cascode mirrors improve output impedance.
5. Operational Amplifiers (Op-Amp)
Ideal Op-Amp Properties
| Parameter | Ideal Value | Typical Value (LM741) |
|---|---|---|
| Open-loop gain | Infinity | ~200,000 |
| Input impedance | Infinity | ~2 MΩ |
| Output impedance | 0 | ~75 Ω |
| Bandwidth | Infinity | ~1 MHz (GBW) |
| CMRR | Infinity | ~90 dB |
| Slew rate | Infinity | 0.5 V/µs |
Virtual Short: With negative feedback, the differential input voltage approaches zero because and any tiny differential drives the output to reduce the difference. Therefore .
Virtual Open: Ideal input impedance is infinite, so no current flows into the input terminals.
Essential Op-Amp Circuits
Inverting amplifier:
Non-inverting amplifier:
Voltage follower (buffer):
Differential amplifier (with matched resistors and ):
Summing amplifier:
Integrator (Miller integrator):
Differentiator:
import numpy as np
import matplotlib.pyplot as plt
# Inverting amplifier frequency response simulation
f = np.logspace(1, 7, 1000) # 10 Hz to 10 MHz
GBW = 1e6 # 1 MHz gain-bandwidth product
R1, Rf = 1e3, 10e3 # Resistor values
Av_ideal = -Rf / R1 # Ideal gain = -10
# Open-loop gain (first-order model)
A_open = GBW / (1j * f)
# Closed-loop gain
beta = R1 / (R1 + Rf)
Av_closed = A_open / (1 + A_open * beta)
plt.figure(figsize=(10, 6))
plt.subplot(2, 1, 1)
plt.semilogx(f, 20*np.log10(np.abs(Av_closed)), 'b-', linewidth=2, label='Actual gain')
plt.axhline(y=20*np.log10(abs(Av_ideal)), color='r', linestyle='--', label='Ideal gain (20 dB)')
plt.ylabel('Gain (dB)')
plt.title('Inverting Amplifier Frequency Response (GBW=1MHz, Av=-10)')
plt.legend()
plt.grid(True, alpha=0.3)
plt.subplot(2, 1, 2)
plt.semilogx(f, np.angle(Av_closed, deg=True), 'g-', linewidth=2)
plt.xlabel('Frequency (Hz)')
plt.ylabel('Phase (degrees)')
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
Schmitt Trigger
A comparator with positive feedback, providing hysteresis to eliminate noise-induced false triggering.
The hysteresis window is .
6. Power Amplifiers
Class Comparison
| Class | Conduction Angle | Theoretical Efficiency | Characteristics |
|---|---|---|---|
| A | 360° | 50% | Best linearity, low efficiency |
| B | 180° | 78.5% | Crossover distortion |
| AB | 180°–360° | 50–78.5% | Practical audio standard |
| C | 0°–180° | >78.5% | RF power amplifiers |
| D | Switching | ~95% | Audio, power conversion |
Push-Pull AB Class Amplifier
Pairs an NPN and PNP transistor to handle each half cycle. A bias voltage of 0.6–0.7 V applied between the bases eliminates the crossover distortion that plagues class B designs. The total harmonic distortion (THD) is significantly reduced compared to class B.
Class D Amplifier
Converts the input to a pulse-width modulated (PWM) signal using a comparator, switches power transistors, then reconstructs the audio with an LC low-pass filter. Efficiency exceeds 90%, making it ideal for battery-powered audio and motor drives.
7. Feedback
Benefits of Negative Feedback
- Gain stabilization: Closed-loop gain becomes independent of open-loop gain variations.
- Bandwidth extension:
- Distortion reduction: Nonlinear distortion is reduced by factor
- Impedance modification: Series feedback increases input impedance; shunt feedback decreases it.
Stability Analysis
Phase Margin (PM) and Gain Margin (GM) from the Bode plot:
- PM > 45°: Stable with good transient response (PM ~60° is typical target)
- GM > 6 dB: Stable
The Nyquist stability criterion states that the closed-loop system is stable if the Nyquist plot of the open-loop transfer function does not encircle the point clockwise.
Oscillators
When positive feedback is applied and the Barkhausen criterion is satisfied ( and or 360°), the circuit oscillates.
- Colpitts oscillator: Uses capacitive voltage divider in the feedback network.
- Hartley oscillator: Uses inductive voltage divider.
- Crystal oscillator: Exploits the piezoelectric resonance of a quartz crystal for high frequency stability.
8. Active Filters
Butterworth Low-Pass Filter
Provides the maximally flat magnitude response in the passband:
The roll-off is dB/decade beyond the cutoff frequency .
Sallen-Key Second-Order Low-Pass Filter
A popular active filter topology using two R's, two C's, and one op-amp:
For a Butterworth response: .
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
# 3rd-order Butterworth low-pass filter (fc = 1 kHz)
fc = 1000 # Hz
order = 3
b, a = signal.butter(order, 2*np.pi*fc, btype='low', analog=True)
f = np.logspace(1, 5, 1000)
w = 2 * np.pi * f
_, H = signal.freqs(b, a, worN=w)
plt.figure(figsize=(10, 5))
plt.subplot(1, 2, 1)
plt.semilogx(f, 20*np.log10(np.abs(H)), 'b-', linewidth=2)
plt.axvline(x=fc, color='r', linestyle='--', label='Cutoff frequency')
plt.xlabel('Frequency (Hz)')
plt.ylabel('Gain (dB)')
plt.title('3rd-Order Butterworth LPF')
plt.legend()
plt.grid(True, alpha=0.3)
plt.subplot(1, 2, 2)
plt.semilogx(f, np.angle(H, deg=True), 'g-', linewidth=2)
plt.axvline(x=fc, color='r', linestyle='--', label='Cutoff frequency')
plt.xlabel('Frequency (Hz)')
plt.ylabel('Phase (degrees)')
plt.title('Phase Response')
plt.legend()
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
State Variable Filter
Implements low-pass, band-pass, and high-pass outputs simultaneously using three op-amps. Allows independent tuning of frequency and Q, making it ideal for parametric equalizers.
9. Power Supply Circuits
Linear Regulators
7805 fixed regulator: Output voltage 5 V, dropout voltage ~2 V, up to 1 A.
Efficiency: — poor when the input-output differential is large.
LM317 adjustable regulator:
Switching Regulators
Buck converter (step-down):
Boost converter (step-up):
Buck-boost converter (inverting):
Switching regulators achieve 85–95% efficiency because the switching transistor dissipates little power (it is either fully on or fully off). The trade-off is electromagnetic interference from switching noise.
Inductor selection:
10. Sensors and Interface Circuits
Temperature Sensor Interfaces
NTC thermistor (Negative Temperature Coefficient): Resistance decreases with temperature.
A Wheatstone bridge linearizes the output; a difference amplifier amplifies the bridge imbalance voltage.
Thermocouple: Generates a small voltage (Seebeck effect, ~10–50 µV/°C). Requires a cold-junction compensation IC and an instrumentation amplifier.
Instrumentation Amplifier (INA128 etc.)
High CMRR (>100 dB) makes it ideal for measuring small differential signals in the presence of large common-mode noise (e.g., ECG, strain gauge, bridge sensors).
ADC/DAC Interface
Key ADC parameters:
- Resolution: n-bit ADC quantizes into levels; LSB =
- SNR: dB (ideal n-bit ADC, full-scale sine wave)
- Sampling rate: Must satisfy (Nyquist criterion)
- Anti-aliasing filter: Low-pass filter before the ADC to remove frequencies above
SPI and I2C are the dominant serial interfaces for ADC/DAC chips in embedded systems.
11. AI Hardware and Analog Circuits
Analog Computing for Neural Networks
Deep learning inference in hardware has revived interest in analog circuits for their energy efficiency.
Analog multiply-accumulate (MAC) unit: The core operation in neural network inference. Using Ohm's law (), conductance encodes a weight and voltage encodes an input — multiplication is performed physically. An array of such cells (crossbar array) performs a full matrix-vector multiply in a single step.
Processing-In-Memory (PIM): Flash, SRAM, or ReRAM cells store weights in-place and perform multiplication inside the memory array, eliminating the von Neumann bottleneck of moving data between memory and processor.
Mixed-Signal Design in AI Chips
Modern AI accelerators (e.g., Google TPU, Apple Neural Engine) blend digital MAC arrays with:
- High-speed ADCs to convert analog outputs from crossbar arrays
- DACs for weight update in on-chip training
- Phase-locked loops (PLLs) for precise clock generation
- Low-dropout (LDO) regulators for supply noise isolation
Power Management for Edge AI
Battery-powered edge inference demands aggressive power optimization:
- DVFS (Dynamic Voltage and Frequency Scaling): Lower supply voltage reduces switching energy quadratically but also reduces speed.
- Power gating: Completely shut down unused compute blocks between inference calls.
- Quantization: Reducing weight precision from 32-bit float to 8-bit integer cuts memory bandwidth and power by 4×.
- Analog sub-threshold circuits: Operating MOSFETs in weak inversion achieves nW-level power for always-on keyword detection.
12. Quiz
Q1. What is the thermal voltage (Vt) of a diode at room temperature (25°C)?
Answer: Approximately 26 mV (more precisely 25.85 mV).
Explanation: The thermal voltage is given by . Substituting the Boltzmann constant J/K, absolute temperature K (25°C), and electron charge C gives approximately 26 mV. This value sets the scale of the exponential I-V characteristic and is fundamental to all small-signal diode and transistor analysis.
Q2. What is the "Virtual Short" concept in an op-amp circuit?
Answer: In an ideal op-amp with negative feedback, the voltages at the inverting and non-inverting input terminals are assumed to be equal.
Explanation: The two terminals are not physically shorted. However, because the open-loop gain is extremely large (often 100,000 or more), even a tiny differential input voltage would drive the output to the supply rail. Negative feedback continuously adjusts the output to keep the differential input near zero. This virtual short principle lets us easily analyze the gain of inverting and non-inverting amplifiers without solving complex circuit equations.
Q3. What happens when an emitter resistor (Re) is used in a common-emitter amplifier without a bypass capacitor?
Answer: The voltage gain decreases, but bias stability improves, input impedance increases, and distortion is reduced.
Explanation: Without a bypass capacitor, the small-signal gain becomes . The extra in the denominator reduces the gain but introduces negative feedback that stabilizes the Q-point against temperature and device variation. The input impedance seen at the base becomes , which can be much larger than alone. This is a direct application of emitter degeneration (series-series negative feedback).
Q4. A Buck converter has a duty cycle of 0.4 and an input voltage of 12 V. What is the output voltage?
Answer: 4.8 V
Explanation: The ideal voltage conversion ratio of a Buck converter is . With D = 0.4 and = 12 V: V. The duty cycle is controlled by the PWM controller in a feedback loop to regulate the output against load and line variations. The inductor and output capacitor form a low-pass filter that smooths the switched waveform.
Q5. What is the key difference between a Butterworth filter and a Chebyshev filter?
Answer: A Butterworth filter has a maximally flat passband (no ripple), while a Chebyshev filter allows equiripple in the passband in exchange for a steeper roll-off.
Explanation: Butterworth filters are designed so that the magnitude response is as flat as possible in the passband, which minimizes signal distortion. Chebyshev Type I filters exhibit equal-magnitude ripple throughout the passband, but for the same filter order achieve a much sharper transition from passband to stopband. The choice depends on the application: audio and measurement systems favor Butterworth for flat amplitude response, while communications and anti-aliasing filters often use Chebyshev or elliptic designs for steeper roll-off with the same component count.
References
- Sedra & Smith — Microelectronic Circuits, 8th Edition (Oxford University Press) — The definitive undergraduate textbook for analog electronics.
- Razavi — Design of Analog CMOS Integrated Circuits, 2nd Edition (McGraw-Hill) — Essential for IC design.
- Texas Instruments — Op Amp Applications Handbook (Free PDF at ti.com) — Comprehensive practical Op-Amp design reference.
- Horowitz & Hill — The Art of Electronics, 3rd Edition (Cambridge University Press) — Practical circuits bible.
- LTspice — Free SPICE simulator from Analog Devices (analog.com/ltspice) — Industry-standard tool for analog circuit simulation.
- Falstad Circuit Simulator — Browser-based free circuit simulator (falstad.com/circuit) — Great for quick visualization.
This guide covers the core topics of analog electronics as taught in a typical first or second-year electrical engineering curriculum. Work through the Python simulations, use LTspice to verify your designs, and pair this guide with Sedra & Smith for rigorous mathematical treatment.