Digital Electronics and Microcontrollers — formula sheet
Instrumentation Engineering · GATE IN · SI units. Drafted with Aria, checked by the AiCanCode.org team.
Number systems, codes and Boolean algebra
N = Σ dᵢ · rⁱ— value of a number with digits dᵢ in radix r (i < 0 for fractional digits).−X = 2ⁿ − X— n-bit 2's complement of X; range −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1.gᵢ = bᵢ₊₁ ⊕ bᵢ— binary to Gray code (MSB copied); Gray to binary:bᵢ = bᵢ₊₁ ⊕ gᵢ.A + A' = 1,A · A' = 0— complement laws; A is a Boolean variable.A + 0 = A,A · 1 = A,A + 1 = 1,A · 0 = 0— identity and null laws.A + A = A,A · A = A— idempotent laws.A + AB = A,A(A + B) = A— absorption.A + A'B = A + B,A' + AB = A' + B— redundant-literal rule.(A + B)' = A'·B',(A·B)' = A' + B'— De Morgan's theorems.AB + A'C + BC = AB + A'C— consensus theorem.A ⊕ B = A'B + AB'— exclusive-OR.2^(2ⁿ)— number of distinct Boolean functions of n variables.
Logic minimisation with Karnaugh maps
Cells = 2ⁿ— n input variables; rows and columns in Gray order (00, 01, 11, 10).Literals in a group = n − k— for a group of 2ᵏ adjacent cells.Minterms covered by a p-literal term = 2^(n − p).F(POS) = [minimal SOP of F']'— group the 0s and apply De Morgan.
Logic families: TTL and CMOS characteristics
NM_H = V_OH(min) − V_IH(min),NM_L = V_IL(max) − V_OL(max)— noise margins (V).Fan-out = min(I_OL / |I_IL|, |I_OH| / I_IH)— DC fan-out from datasheet currents (A).t_pd = (t_PHL + t_PLH) / 2— average propagation delay (s).SPP = t_pd × P_D— speed-power product (J); P_D is power per gate (W).P_dyn = α · C_L · V_DD² · f— CMOS dynamic power (W); C_L load capacitance (F), V_DD supply (V), f clock (Hz), α activity factor.R_P(min) = (V_CC − V_OL) / (I_OL − n·|I_IL|)— minimum pull-up for an open-collector output driving n loads (Ω).
Combinational circuits: adders, multiplexers, decoders
S = A ⊕ B,C = A · B— half adder.S = A ⊕ B ⊕ Cᵢₙ,Cₒᵤₜ = AB + BCᵢₙ + ACᵢₙ— full adder.Gᵢ = AᵢBᵢ,Pᵢ = Aᵢ ⊕ Bᵢ,Cᵢ₊₁ = Gᵢ + PᵢCᵢ— carry-lookahead generate, propagate and carry.t_ripple = (n − 1)·t_carry + max(t_sum, t_carry)— worst-case ripple-carry delay for n bits (s).V = Cₙ ⊕ Cₙ₋₁— 2's complement overflow flag.Select lines = log₂(data inputs)— multiplexer; a 2ⁿ:1 MUX needs 2ⁿ − 1 two-input MUXes.
Comparators, encoders and arithmetic circuits
xᵢ = AᵢBᵢ + Aᵢ'Bᵢ'— bit equality (XNOR).(A = B) = x₃x₂x₁x₀— 4-bit equality.(A > B) = A₃B₃' + x₃A₂B₂' + x₃x₂A₁B₁' + x₃x₂x₁A₀B₀'— 4-bit magnitude comparison.D = A ⊕ B ⊕ Bᵢ,Bₒ = A'B + A'Bᵢ + BBᵢ— full subtractor (Bᵢ borrow in, Bₒ borrow out).A − B = A + B' + 1— subtraction by 2's complement.n × m multiplier: n·m AND gates, (m − 1) n-bit adders, n + m product bits.C = K + Z₃Z₂ + Z₃Z₁— BCD adder decimal carry (K binary carry, Z binary sum bits).
Latches and flip-flops
Q⁺ = D— D flip-flop; Q⁺ is the next state.Q⁺ = JQ' + K'Q— JK flip-flop.Q⁺ = T ⊕ Q— T flip-flop.Q⁺ = S + R'Q, withSR = 0— SR flip-flop.T_clk(min) = t_pd + t_comb(max) + t_su,f_max = 1 / T_clk(min)— clock limit (s, Hz).t_pd(min) + t_comb(min) ≥ t_h— hold-time condition.
Shift registers and counters
f_out = f_in / N— MOD-N counter output frequency (Hz).n = ⌈log₂ N⌉— flip-flops needed for N states.f_max(ripple) = 1 / (n · t_pd)— ripple counter whose count must settle each period.f_max(sync) = 1 / (t_pd + t_gate + t_su)— synchronous counter.Ring = n states,Johnson = 2n states,maximal LFSR = 2ⁿ − 1 states— n flip-flops.
Synchronous sequential circuit design and state machines
n = ⌈log₂ S⌉— flip-flops for S states with binary encoding (one-hot uses S).T = Q ⊕ Q⁺— T flip-flop excitation; D flip-flop:D = Q⁺.JK excitation: 0→0: J=0,K=X; 0→1: J=1,K=X; 1→0: J=X,K=1; 1→1: J=X,K=0.
Sample-and-hold circuits
dV/dt = I_L / C_H— droop rate (V/s); I_L leakage current (A), C_H hold capacitance (F).ΔV_ped = Q_inj / C_H— hold step from switch charge injection Q_inj (C).V_err = 2π·f·V_p·Δt_a— aperture error for a sine of peak V_p (V) and frequency f (Hz); Δt_a aperture uncertainty (s).f_max = (½ LSB) / (2π·V_p·Δt)— highest sine frequency for ½ LSB error.t_acq ≈ R·C_H·ln(2ⁿ⁺¹)— RC settling to ½ LSB of an n-bit step (s).
Digital-to-analog converters: weighted resistor and R-2R
V_o = −V_R·(R_f / R)·Σ bᵢ·2^(i − (n − 1))— weighted resistor DAC, MSB resistor R; withR_f = R/2:V_o = −V_R·D / 2ⁿ.V_o = −V_R·(R_f / R)·D / 2ⁿ— current-mode R-2R ladder; D is the decimal value of the input word.V_LSB = V_R / 2ⁿ— step size (V).V_FS = V_R·(1 − 2⁻ⁿ)— full-scale output (all 1s).I_ref = V_R / R— constant reference current of an R-2R ladder (A).
ADCs: flash, successive approximation and dual-slope
1 LSB = V_FS / 2ⁿ— resolution (V); quantisation error ±½ LSB (rounding).SQNR ≈ 6.02·n + 1.76 dB— ideal, full-scale sine.Comparators (flash) = 2ⁿ − 1.t_conv(SAR) ≈ n·T_clk,t_conv(counter, max) = 2ⁿ·T_clk.V_in·T₁ = V_R·T₂→N₂ = N₁·V_in / V_R— dual-slope ADC (T₁ fixed, T₂ measured).V_int(peak) = V_in·T₁ / (R·C)— dual-slope integrator peak (V).
Semiconductor memories
Capacity = 2ⁿ × m bits— n address lines, m data lines.Chips = (W_req / W_chip) × (m_req / m_chip)— memory expansion.Decoder inputs = log₂(banks).t_row = T_refresh / N_rows— DRAM distributed-refresh interval (s).
Microprocessor architecture and instruction cycle
Addressable locations = 2ⁿ— n address lines.f_clk = f_crystal / 2— 8085 internal clock.Instruction time = T-states × T— T = 1/f_clk.CPU time = IC × CPI / f_clk— IC instruction count, CPI cycles per instruction.Pipeline cycles = k + N − 1,speed-up = N·k / (k + N − 1)— k stages, N instructions.
Microcontroller architecture and programming model
T_MC = 12 / f_osc— classic 8051 machine cycle (s).t_instr = machine cycles × T_MC.R0 address = 8 × (2·RS1 + RS0)— 8051 register bank (00H, 08H, 10H, 18H).
Memory and I/O interfacing
Address lines = log₂(locations).End address = start + size − 1.Mirror images = 2ᵖ— p undecoded high-order address lines.Keypad lines = r + c— r × c matrix.R = (V_CC − V_F) / I_F— LED series resistor (Ω).Wait states = ⌈(t_access − t_allowed) / T_clk⌉.
Timers, interrupts and serial communication
t_delay = (2ᵏ − N)·T_tick— up-counting k-bit timer from initial count N; 8051:T_tick = 12 / f_osc.Baud = 2^SMOD · f_osc / (384·(256 − TH1))— 8051 serial mode 1 with Timer 1 in mode 2.f_PWM = f_tick / (TOP + 1),Duty = OCR / (TOP + 1).Bytes/s = baud / bits per frame— 8N1 frame = 10 bits.
Data acquisition systems
f_s > 2·f_max— Nyquist criterion (practical 5–10·f_max).f_alias = |f − k·f_s|— apparent frequency of an undersampled component.f_aggregate = N_ch·f_s,ch,t_slot = 1 / f_aggregate ≥ t_mux + t_acq + t_conv.n ≥ log₂(span / resolution)— ADC bits needed.G = V_ADC,FS / V_sensor,max— conditioning gain.