Basic Electronics

Chapter 11
Digital Electronics Foundations

Bachelors Program in Electronics and Communication
Basic Electronics   •   Post Graduate

Digital Electronics Foundations

Introduction and Context

Digital electronics is the branch of electronics concerned with the representation, processing, storage, and transmission of information using discrete signal states. In most practical systems these states are represented by two voltage ranges and interpreted as binary 0 and 1. Digital circuits form the physical basis of computers, communication equipment, embedded controllers, industrial automation, instrumentation, consumer electronics, and modern cyber-physical systems.

The distinction between analog and digital is conceptual rather than absolute. An analog signal can assume a continuous range of values, whereas a digital signal is interpreted through discrete logic levels. Physical digital circuits are nevertheless analog devices at the transistor level: voltages change continuously, transitions have finite duration, and noise margins are determined by electrical characteristics. Consequently, advanced digital design requires both Boolean reasoning and an understanding of device-level limitations.

This chapter develops the foundations required to analyze and design digital systems. It introduces number systems, Boolean algebra, logic gates, combinational and sequential circuits, timing, memory, programmable logic, and practical design constraints. Particular attention is given to the relationship between abstract logic and real hardware.

Learning Objectives

After studying this chapter, the reader should be able to:

  1. Explain binary representation and convert numbers among common digital number systems.
  2. Apply Boolean algebra and truth tables to simplify logic expressions.
  3. Analyze the operation and limitations of fundamental logic gates.
  4. Distinguish combinational from sequential logic.
  5. Design basic adders, multiplexers, decoders, counters, and registers.
  6. Interpret propagation delay, setup time, hold time, noise margin, and fan-out.
  7. Explain the role of memory, programmable logic, and hardware description languages.
  8. Evaluate a digital design through functional, timing, power, reliability, and security considerations.

1. Digital Representation and Logic Levels

A binary digit, or bit, has two logical states. A group of eight bits is a byte. Digital systems use codes to represent numerical, textual, control, and sensor information. The meaning of a bit pattern depends on the encoding convention: the pattern 01000001 may represent decimal 65, the character “A” in ASCII, or a control value in a particular application.

A real logic family specifies voltage ranges rather than ideal values. For a positive-logic system, a low voltage is interpreted as 0 and a high voltage as 1. The input-low and input-high ranges are separated by an undefined region that should not be used for reliable operation.

Important electrical terms include:

  • Logic threshold: A voltage region at which the receiver changes its interpretation.
  • Noise margin: The voltage disturbance that can be tolerated without causing an incorrect logic value.
  • Fan-out: The number of standard logic inputs that one output can drive while preserving specifications.
  • Propagation delay: The time between a valid input change and the corresponding output change.
  • Rise time and fall time: The time required for a signal to transition between specified voltage limits.

For a conventional positive-logic interface, approximate noise margins are expressed as

NMH = VOH(min) − VIH(min)
NML = VIL(max) − VOL(max)

Here, VOH(min) is the minimum output-high voltage, VIH(min) is the minimum input-high voltage, VIL(max) is the maximum input-low voltage, and VOL(max) is the maximum output-low voltage. All quantities are voltages, normally measured in volts. These expressions apply when the output specifications of one device are compared with the input specifications of a compatible receiving device.

A larger noise margin generally improves immunity to interference, but it does not eliminate problems caused by ground bounce, crosstalk, electromagnetic interference, or slow transitions.

2. Number Systems and Codes

2.1 Positional notation

In a radix or base b number system, a number is represented as

N = ∑i=0n−1 di bi

where di is the digit in position i, b is the base, and n is the number of digits. For a valid representation, each digit satisfies 0 ≤ di < b.

Binary uses base 2, octal uses base 8, decimal uses base 10, and hexadecimal uses base 16. Hexadecimal digits A through F represent decimal values 10 through 15. Hexadecimal is particularly useful because one hexadecimal digit corresponds exactly to four binary bits.

Worked example. Convert hexadecimal 3A7 to decimal:

3A716 = 3×162 + 10×161 + 7×160 = 768 + 160 + 7 = 93510

To convert a positive decimal integer to binary, repeated division by 2 is used; the remainders are read from bottom to top. Fractional conversion uses repeated multiplication by 2, recording the integer part at each step. A finite decimal fraction does not necessarily have a finite binary representation.

2.2 Signed binary numbers

Unsigned n-bit binary represents values from 0 through 2n − 1. Several conventions represent signed values:

  • Sign-magnitude uses one sign bit and a magnitude field, but has both positive and negative zero.
  • One’s complement forms a negative number by complementing every bit and also has two zeros.
  • Two’s complement forms a negative number by complementing every bit and adding 1. It has one zero and is the dominant representation in digital processors.

An n-bit two’s-complement number represents the range

−2n−1 ≤ x ≤ 2n−1 − 1

The range is asymmetric because one bit pattern is assigned to the most negative value. For example, using eight bits, +37 is 00100101. Its negative is obtained as follows: complement to 11011010, then add 1 to obtain 11011011, which represents −37.

Overflow occurs when the mathematical result lies outside the representable range. In two’s-complement addition, adding two positive numbers and obtaining a negative result, or adding two negative numbers and obtaining a positive result, indicates overflow. A carry out of the most significant bit alone does not reliably indicate signed overflow.

2.3 Codes

Binary-coded decimal (BCD) represents each decimal digit with four bits. Decimal 59 is represented as 0101 1001, not as the pure binary representation of 59. BCD simplifies decimal display and financial calculations but uses some bit patterns inefficiently.

Gray code changes only one bit between adjacent code words. This property reduces ambiguity in position encoders, where several bits may not switch at exactly the same instant. Error-detecting codes add redundancy so that selected classes of errors can be detected. A parity bit, for example, can detect any odd number of bit inversions but cannot identify the error location and cannot detect an even number of inversions.

3. Boolean Algebra and Logic Gates

Boolean algebra operates on variables that take values 0 or 1. The basic operations are AND, OR, and NOT, represented respectively by multiplication-like conjunction, addition-like disjunction, and complementation. Boolean symbols should not be confused with ordinary arithmetic: A + A = A in Boolean algebra, whereas ordinary arithmetic gives 2A.

The fundamental identities include:

A + 0 = A, A·1 = A, A + 1 = 1, A·0 = 0
A + A = A, A·A = A, A + A̅ = 1, A·A̅ = 0
(A·B)̅ = A̅ + B̅
(A + B)̅ = A̅·B̅

The final two equations are De Morgan’s theorems. They are important for transforming active-high logic into active-low logic and for implementing circuits using NAND or NOR gates.

A truth table specifies the output for every possible input combination. For n binary inputs, a complete truth table contains 2n rows. A Boolean expression may be written as a sum of products or a product of sums. Canonical sum-of-products notation uses minterms, each of which is 1 for exactly one input combination.

3.1 Universal gates

A NAND gate produces the complement of AND:

Y = (A·B)̅

A NOR gate produces the complement of OR:

Y = (A + B)̅

NAND and NOR are universal gates because NOT, AND, and OR can all be constructed from either one. For example, a NAND input tied to itself acts as an inverter:

A̅ = (A·A)̅

Universal-gate implementation is useful in integrated-circuit design because restricting the gate library can simplify fabrication, testing, and physical layout. It is not always optimal for speed, power, or area.

3.2 Exclusive operations

The exclusive-OR gate, XOR, is 1 when its inputs differ:

A ⊕ B = A̅B + AB̅

XOR is used in adders, parity circuits, comparators, and error-control systems. Exclusive-NOR, or XNOR, is the complement of XOR and indicates equality between two single-bit inputs.

3.3 Simplification

Simplification reduces gate count, delay, and power. Algebraic manipulation, Karnaugh maps, and algorithmic minimization methods such as the Quine–McCluskey procedure can be used. Karnaugh maps are practical for a small number of variables; larger designs are commonly optimized by electronic design automation tools.

A useful example is

F = AB + A̅C + BC = AB + A̅C

The term BC is redundant by the consensus theorem. To verify this, expand:

AB + A̅C + BC = AB + A̅C + BC(A + A̅)

The additional terms are absorbed by AB and A̅C. Such simplification is valid for ideal Boolean functions, but physical hazards must still be considered when signals do not change simultaneously.

4. Combinational Logic

A combinational circuit has outputs determined solely by present inputs. It has no intentional memory. Examples include arithmetic units, multiplexers, decoders, encoders, comparators, and code converters.

4.1 Adders

A half-adder adds two one-bit operands. Its sum and carry outputs are

S = A ⊕ B
C = A·B

A full adder adds operands A and B together with an incoming carry Cin:

S = A ⊕ B ⊕ Cin
Cout = AB + ACin + BCin

A ripple-carry adder connects full adders in series. It is simple, but the carry must propagate through each stage. If each stage contributes a worst-case carry delay tc, an approximate upper bound for an n-bit ripple chain is

tcarry ≈ n·tc

This is a simplified worst-case model; actual delay depends on the implementation and loading. Carry-lookahead and prefix adders reduce carry delay by calculating carry signals in parallel, at the cost of increased hardware complexity and wiring.

4.2 Multiplexers and decoders

A multiplexer selects one of several data inputs and connects it to an output. A multiplexer with 2k inputs requires k select lines. Multiplexers implement data routing and can also realize Boolean functions by connecting inputs to constants or other signals.

A decoder converts an input code into one of several mutually exclusive output lines. A k-to-2k decoder has up to 2k outputs. Enable inputs allow several decoders to share a bus or support hierarchical memory selection.

An encoder performs the reverse operation, but an ordinary encoder assumes only one input is active. A priority encoder resolves the case in which multiple inputs are active by assigning priority.

4.3 Hazards

A static hazard is a temporary glitch produced when logically related paths have unequal delays. For example, a circuit whose ideal output should remain 1 may briefly fall to 0 during an input transition. Hazards are especially significant in asynchronous control systems, clock gating, and interfaces with narrow pulses. Redundant consensus terms can eliminate some static hazards, while registered outputs often prevent internal glitches from being observed by synchronous logic.

5. Sequential Logic and State

A sequential circuit depends on present inputs and stored state. State is held by latches, flip-flops, registers, or memory arrays. Sequential systems are generally classified as synchronous or asynchronous.

In synchronous systems, state changes are coordinated by a clock. A clock is a periodic waveform characterized by period T and frequency f:

f = 1/T

If a clock has a period of 10 ns, its frequency is 100 MHz, assuming an ideal periodic waveform and neglecting clock uncertainty.

5.1 Latches and flip-flops

A latch is level-sensitive: it can respond throughout an enabled level. A flip-flop is commonly edge-triggered: it samples input near a rising or falling clock edge. A D flip-flop obeys the conceptual relation

Qnext = D

at the active clock edge, subject to setup, hold, and electrical constraints.

A setup time is the minimum interval for which the input must be stable before the active edge. A hold time is the minimum interval for which it must remain stable after the edge. Violating either requirement can cause metastability, in which the output takes an unpredictable time to settle to a valid logic state.

For a simple single-clock path, a conservative setup constraint is

Tclk ≥ tcq(max) + tpd(max) + tsetup + tskew + tuncertainty

Here tcq(max) is maximum clock-to-Q delay, tpd(max) is maximum combinational propagation delay, tsetup is receiving flip-flop setup time, tskew represents clock arrival-time difference, and tuncertainty includes jitter and other timing uncertainty. All terms are times. This relation assumes a single synchronous clock domain and a conventional setup analysis; clock polarity, negative skew, and detailed sign conventions must be handled according to the timing methodology used.

5.2 Registers and counters

A register is a group of flip-flops used to store a multi-bit word. Registers may support parallel load, serial shift, or both. Shift registers are used in serial-to-parallel conversion, delay lines, communication interfaces, and sequence generation.

A counter advances through a prescribed sequence of states. A binary counter with n flip-flops has up to 2n states. A modulus-M counter has M distinct states and then repeats. If M is not a power of two, unused states require deliberate handling to prevent lock-up or undesirable sequences.

Finite-state machines (FSMs) provide a systematic model for controllers. A Moore machine produces outputs as functions of state, whereas a Mealy machine produces outputs as functions of state and current input. Mealy outputs can respond more quickly but may be more susceptible to input glitches; Moore outputs often have cleaner timing at the cost of additional states or latency.

6. Memory and Programmable Logic

Digital memory is organized as an array of words. A memory with k address lines can select 2k locations. If each location stores w bits, the total capacity is

Capacity = 2k × w bits

For example, a memory with 12 address lines and 8-bit words contains 4096 words and has a capacity of 32,768 bits, or 4096 bytes.

Read-only memory (ROM) retains a programmed function; programmable ROM, erasable programmable ROM, and electrically erasable non-volatile memory differ in how they are programmed and erased. Static RAM (SRAM) stores each bit in a bistable circuit and is fast but relatively area-intensive. Dynamic RAM (DRAM) stores charge in capacitors and requires periodic refresh; it offers high density but has more complex timing.

Programmable logic devices include programmable logic arrays, complex programmable logic devices, and field-programmable gate arrays (FPGAs). FPGAs typically contain configurable logic blocks, programmable routing, input/output cells, and often embedded memories, arithmetic units, and high-speed transceivers. They support hardware parallelism, but routing congestion, timing closure, power consumption, and configuration security must be addressed.

Hardware description languages such as VHDL and Verilog/SystemVerilog describe structure and behavior. Synthesizable code is translated into hardware, whereas simulation-only constructs may not correspond to physical circuits. Good practice separates combinational and sequential logic, specifies reset behavior, avoids unintended latches, and verifies edge cases through simulation and formal methods.

7. Timing, Power, and Reliability

Digital correctness has at least two dimensions: functional correctness and temporal correctness. A circuit may implement the correct Boolean expression but fail because signals arrive too late, violate pulse-width requirements, or cross clock domains unsafely.

Dynamic power is commonly approximated by

Pdynamic ≈ α CL VDD2 f

where α is the activity factor, CL is switched capacitance in farads, VDD is supply voltage in volts, and f is switching frequency in hertz. The result is in watts. This model assumes capacitive switching dominates and excludes short-circuit and leakage components. It shows why voltage reduction is especially effective: dynamic power varies with the square of supply voltage.

Static or leakage power becomes important in scaled technologies and during standby. Power integrity also depends on decoupling capacitors, package inductance, supply distribution, thermal resistance, and transient load behavior.

Clock-domain crossing requires synchronization. A common approach uses two flip-flops in the receiving domain for a single-bit control signal. This reduces, but does not eliminate, the probability that metastability propagates. Multi-bit data requires protocols such as handshaking, Gray-coded counters, or asynchronous FIFOs; independently synchronizing each bit is generally unsafe because the bits may be captured inconsistently.

Reliability engineering uses redundancy, error-correcting codes, watchdog timers, safe reset design, and fault detection. In safety-critical systems, design claims must be supported by traceable requirements, verification evidence, hazard analysis, and applicable standards.

8. Applied Case: FPGA-Based Industrial Temperature Controller

The following is an illustrative case rather than a report of a specific commercial product.

Background

An industrial process requires temperature regulation within a defined operating band. A sensor interface produces a digital measurement, and an actuator controls a heater. The controller must detect over-temperature conditions and must continue to behave safely if communication or timing faults occur.

Problem

A direct combinational design would compare the sensor word with thresholds and immediately drive the actuator. However, sensor data may arrive asynchronously, the measurement may contain noise, and a brief comparator glitch could cause undesirable switching. The design also needs configuration registers, status reporting, and a fail-safe response.

Analysis

The architecture is divided into clocked blocks:

  1. An input interface samples or receives the sensor value.
  2. A clock-domain crossing mechanism transfers data safely if the sensor clock differs from the controller clock.
  3. A register stores a coherent measurement word.
  4. A comparator determines whether the temperature is below, within, or above limits.
  5. An FSM applies hysteresis and controls the heater.
  6. A watchdog detects missing updates.
  7. A fault block overrides normal operation when an over-temperature or communication fault is detected.

Hysteresis prevents rapid switching near a threshold. If the heater turns on below Tlow and turns off above Thigh, with Thigh > Tlow, the interval between thresholds provides noise tolerance. The sensor resolution must also be considered. If an n-bit unsigned sensor covers a range from Tmin to Tmax, the ideal quantization step is approximately

ΔT ≈ (Tmax − Tmin) / (2n − 1)

This assumes uniformly spaced endpoint codes and an ideal converter. Real accuracy additionally includes offset, gain error, nonlinearity, noise, and calibration uncertainty.

Approach and solution

The input is synchronized and registered. The FSM has states such as SAFE_OFF, HEATING, HOLDING, and FAULT. Its transition logic is implemented combinationally, while state updates occur on a clock edge. The actuator output is registered so that internal comparator hazards do not directly control the power device. A separate independent over-temperature path can disable the heater even if the main controller is malfunctioning.

Outcome

The resulting architecture is easier to verify than an unstructured logic network. Timing constraints can be checked, sensor updates can be monitored, and safety actions can be tested independently. The design does not guarantee physical safety by itself: the actuator, power stage, sensor placement, thermal inertia, and system-level protections must also be validated.

Learning points

The case illustrates that digital design is not merely the minimization of Boolean expressions. A robust implementation integrates representation, synchronization, state modeling, timing analysis, fault response, verification, and physical safety.

9. Contemporary Developments and Critical Considerations

Modern digital systems increasingly combine general-purpose processors, FPGAs, application-specific integrated circuits, sensors, wireless interfaces, and machine-learning accelerators. AI is relevant when digital hardware executes inference or adaptive control, but the underlying foundations remain Boolean logic, arithmetic, memory, and timing. AI-assisted design tools can propose RTL, optimize placement, or identify verification gaps; their outputs require expert review because generated hardware may contain functional, timing, security, or licensing defects.

Security is now a design requirement rather than an optional feature. Threats include fault injection, side-channel leakage, insecure boot configuration, unauthorized debug access, and hardware Trojans. Countermeasures include secure boot, authenticated configuration, privilege separation, constant-time or balanced implementations where appropriate, tamper monitoring, and lifecycle key management.

Designers should also consider electromagnetic compatibility, recyclability, supply-chain provenance, accessibility of test equipment, and responsible disposal of electronic hardware. Standards and regulatory requirements vary by application, jurisdiction, and risk class; compliance should be established from the applicable technical standards rather than assumed from generic digital behavior.

Best-Practice Design Workflow

A disciplined digital design workflow normally includes:

  1. Define functional, timing, power, safety, and interface requirements.
  2. Choose representations, word lengths, signedness, and coding conventions explicitly.
  3. Partition the system into combinational, sequential, memory, and interface blocks.
  4. Identify clock domains and asynchronous inputs at the beginning.
  5. Develop truth tables, state diagrams, and timing assumptions before coding.
  6. Simulate normal, boundary, illegal, reset, and fault conditions.
  7. Apply static timing analysis and inspect clock-domain crossings.
  8. Verify synthesized hardware rather than relying only on RTL simulation.
  9. Measure power, signal integrity, and thermal behavior on the physical implementation.
  10. Document requirements, assumptions, test evidence, revisions, and known limitations.

Chapter Summary

Digital electronics represents information with discrete logical states, but its physical implementation remains subject to analog voltage, current, noise, delay, and power effects. Binary, hexadecimal, signed two’s-complement, BCD, and Gray-code representations provide different solutions to numerical and interface requirements. Boolean algebra, truth tables, universal gates, XOR operations, and minimization methods form the foundation of logic design.

Combinational circuits calculate outputs from present inputs, whereas sequential circuits store state and depend on clocking and timing constraints. Adders, multiplexers, decoders, registers, counters, finite-state machines, memories, and programmable logic are central building blocks. Propagation delay, setup and hold time, metastability, clock-domain crossing, noise margin, fan-out, and power must be considered alongside Boolean functionality.

Professional digital design combines architectural decomposition, hardware description, simulation, formal reasoning, timing analysis, physical measurement, security, safety, and documentation. The industrial controller case demonstrates how these concepts cooperate in a dependable system.

Key Terms

Bit: A binary digit with logical value 0 or 1.

Byte: A group of eight bits.

Boolean algebra: Algebraic system for variables restricted to 0 and 1.

Logic gate: Circuit that implements a Boolean operation.

NAND gate: Complement of the AND operation; a universal gate.

Noise margin: Tolerable voltage disturbance while preserving logic interpretation.

Fan-out: Number of receiving inputs an output can drive within specifications.

Propagation delay: Time between an input change and the corresponding output response.

Two’s complement: Signed binary representation formed by complementing and adding one.

Combinational circuit: Circuit whose output depends on present inputs only.

Sequential circuit: Circuit whose output depends on present inputs and stored state.

Flip-flop: Edge-triggered storage element.

Setup time: Required input stability interval before a clock edge.

Hold time: Required input stability interval after a clock edge.

Metastability: Temporary uncertain state caused by a timing violation.

Multiplexer: Circuit that selects one of several inputs.

Finite-state machine: Sequential model consisting of states, transitions, inputs, and outputs.

FPGA: Reconfigurable integrated circuit containing programmable logic and routing.

Clock-domain crossing: Transfer of signals between independently timed domains.

Dynamic power: Power associated primarily with charging and discharging capacitances.

Review Questions

Short Answer Questions

  1. What is the principal difference between combinational and sequential logic?
  2. State De Morgan’s two Boolean theorems.
  3. Why is Gray code useful in position encoders?
  4. Define setup time and hold time.
  5. What is meant by fan-out?

Long Answer Questions

  1. Explain binary, hexadecimal, BCD, sign-magnitude, and two’s-complement representations, including their applications and limitations.
  2. Derive the sum and carry equations of a full adder and explain how ripple-carry delay arises.
  3. Describe the operation of latches, flip-flops, registers, and counters in a synchronous system.
  4. Explain memory organization and compare SRAM, DRAM, ROM, and FPGA-based storage.
  5. Discuss a complete digital design workflow, including functional verification, timing analysis, power evaluation, and security.

Analytical / Application Questions

  1. An eight-bit two’s-complement processor adds 01100110 and 00110101. Determine the binary result and decide whether signed overflow occurs. Justify the answer.
  2. A synchronous path has maximum clock-to-Q delay 1.2 ns, maximum combinational delay 5.0 ns, setup time 0.8 ns, clock skew 0.3 ns, and uncertainty 0.2 ns. Determine the minimum clock period using the stated setup constraint and calculate the corresponding maximum ideal clock frequency.
  3. Design an illustrative temperature-controller state machine with heating, holding, safe-off, and fault states. Specify the transition conditions, the role of hysteresis, and at least two mechanisms for handling asynchronous sensor data safely.

Multiple Choice Questions with Answers

Question 1

Which representation is normally used for signed integer arithmetic in modern digital processors?

A. Sign-magnitude

B. One’s complement

C. Two’s complement

D. BCD

Correct Answer: C. Two’s complement

Question 2

A 12-bit address bus can select how many distinct memory locations?

A. 12

B. 144

C. 2048

D. 4096

Correct Answer: D. 4096

Question 3

Which gate is universal because it can be used alone to construct NOT, AND, and OR functions?

A. XOR

B. NAND

C. XNOR

D. AND

Correct Answer: B. NAND

Question 4

For a full adder, which expression gives the sum output?

A. AB

B. A + B + C_{in}

C. A ⊕ B ⊕ C_{in}

D. (A + B)̅

Correct Answer: C. A ⊕ B ⊕ C_{in}

Question 5

A circuit whose output depends only on its present inputs is classified as:

A. Sequential

B. Combinational

C. Memory-based

D. Clock-domain crossing

Correct Answer: B. Combinational

Question 6

What is the primary danger of violating the setup or hold time of a flip-flop?

A. Permanent short circuit

B. Metastability

C. Automatic power reduction

D. Guaranteed logic inversion

Correct Answer: B. Metastability

Question 7

If a clock period is 20 ns, what is its frequency under ideal periodic operation?

A. 5 MHz

B. 20 MHz

C. 50 MHz

D. 200 MHz

Correct Answer: C. 50 MHz

Question 8

Which code changes only one bit between adjacent code words?

A. BCD

B. Gray code

C. ASCII

D. One’s-complement code

Correct Answer: B. Gray code

Question 9

Using the approximation Pdynamic ≈ α CL VDD2 f, which change most directly reduces dynamic power through the squared factor?

A. Increasing supply voltage

B. Reducing supply voltage

C. Increasing switched capacitance

D. Increasing switching frequency

Correct Answer: B. Reducing supply voltage

Question 10

Why is independently synchronizing each bit of a multi-bit asynchronous data word generally unsafe?

A. It always reverses the word order

B. It prevents all metastability

C. Different bits may be captured from different source values

D. It converts binary data into Gray code

Correct Answer: C. Different bits may be captured from different source values

Basic Electronics
Chapter 11 of 11