Lessons in Electric Circuits Volume IV Digital Study Guide and Chapter Summaries – Tony R. Kuphaldt (4th Edition, 2021) BSCS

BSCS and BSEE students can use this guide to study the digital volume of Tony R. Kuphaldt’s open textbook series, “Lessons in Electric Circuits, Volume IV: Digital”. It is the standard free text for a first Digital Logic Design course, and the author publishes it under the Creative Commons Attribution licence (CC BY 4.0), so you can read, share and reuse it with credit.

The book starts with number systems and binary arithmetic, then builds up through logic gates, Boolean algebra and Karnaugh maps to adders, multiplexers, latches, flip-flops, counters and shift registers. It also covers data conversion (ADC and DAC), digital communication, memory and the basic ideas of a computer. An unusual extra is the early chapters on switches, relays and ladder logic, which show the same AND, OR and NOT ideas in industrial control. Each chapter has worked examples, so it suits both semester study and revision before a paper.

Book Overview

CourseDigital Logic Design
Degree ProgramsBSCS, BSEE
LevelUniversity / Undergraduate
EditionFourth Edition, last updated November 6, 2021
AuthorTony R. Kuphaldt
SourceAuthor’s site (ibiblio); web edition on All About Circuits
Total Chapters16 chapters, plus 3 appendices
ExercisesWorked examples and review lists in the chapters; no end-of-chapter problem sets
LanguageEnglish
LicenseCreative Commons Attribution 4.0 International (CC BY 4.0)
FormatPDF, HTML and LaTeX source

Chapter List

Chapter 1: Numeration Systems

Difficulty: Easy · Key topics: numbers vs symbols, analog vs digital, Roman numerals, place value, binary, octal, hexadecimal, base conversion

The chapter separates numbers, which are quantities, from the symbols used to write them, and contrasts analog representation (infinitely divisible, like a thermometer) with digital representation (discrete symbols, like an abacus). It looks at Roman numerals and their missing zero, then at place-value systems and the idea of a base. Binary and decimal are compared side by side from zero to twenty, and octal and hexadecimal are introduced as shorthand for groups of bits. The chapter ends with conversions: any base to decimal by place weights, and decimal to binary by trial-and-fit, repeated division and repeated multiplication.

Key Points:

  • A bit is a binary digit; the LSB is the lowest-weight bit and the MSB the highest-weight bit.
  • A place-weighted system with n places and base b can show b to the power n values, so 8 bits give 256 values.
  • Octal groups bits in threes and hexadecimal in fours: 10110111.1 in binary is 267.4 in octal and B7.8 in hex.
  • Hexadecimal is more popular because common bit widths (8, 16, 32, 64, 128) are multiples of 4 but not of 3.
  • To convert to decimal, multiply each digit by its place weight and add: 30F.A9 in hex is 783.66015625.
  • From decimal, use repeated division by the base for the whole part and repeated multiplication for the fraction: 54.40625 is 110110.01101 in binary.

Memory Tip: Group the bits outward from the binary point: threes for octal, fours for hex, and pad the outer groups with zeros.

Common Mistake: Reading a numeral without checking its base. The digits 101 mean five in binary, sixty-five in octal and one hundred and one in decimal.

Important Questions:

  • Why is hexadecimal preferred over octal for computer work? Typical word sizes of 8, 16, 32, 64 and 128 bits divide evenly into groups of four bits (one hex digit) but not into groups of three.
  • How do you convert the fraction 0.8125 to binary? Multiply the fraction by 2 again and again and collect the whole-number parts: 1, 1, 0, 1, giving 0.1101.

Chapter 2: Binary Arithmetic

Difficulty: Medium · Key topics: binary addition, carry, sign-magnitude, two’s complement, subtraction, overflow, byte, nibble

This chapter starts from the point that the numeration system does not change the result of arithmetic, and then shows how circuits do it in binary. Addition works column by column with only a few rules and a carry. Negative numbers are first tried as sign-magnitude, which is rejected as impractical for addition, and then handled by complementation, where the leftmost bit has a negative weight. Subtraction becomes addition of a negative number, overflow is explained with a six-bit example, and the chapter closes with bit groupings such as the byte and the nibble.

Key Points:

  • Binary addition rules: 0+0=0, 1+0=1, 1+1=10 and 1+1+1=11, so the carry moves to the next column.
  • In a four-bit complement field the leftmost bit has weight -8, giving a range of -8 to +7.
  • Two’s complement is found by inverting every bit and adding one.
  • For subtraction, add the negative number and discard the carry beyond the sign bit: 0111 + 1011 = 0010, so 7 – 5 = 2.
  • Overflow happens when a sum leaves the range of the bit field (+31 to -32 in six bits); it shows up as a sum whose sign differs from the signs of the two addends.
  • Adding numbers of opposite sign can never overflow.
  • A byte is 8 bits and a nibble is 4 bits; the meaning of “word” depends on the system.

Memory Tip: To read a complement number, give the leftmost bit its negative weight and add the rest normally: in four bits, 1011 is -8 + 2 + 1 = -5.

Common Mistake: Keeping the carry out of the leftmost bit as part of the answer. In 0111 + 1011 = 10010 the fifth bit is dropped, and the answer is 0010.

Important Questions:

  • How do you form the two’s complement of a binary number? Invert all the bits (the one’s complement) and add one; for example 101 becomes 010 + 1 = 011 in three bits.
  • How can you tell that an addition has overflowed? The sign of the sum differs from the sign of the addends. In a six-bit field, 17 + 19 wrongly gives -28 because 36 is outside the range +31 to -32.

Chapter 3: Logic Gates

Difficulty: Medium · Key topics: inverter, buffer, AND, OR, NAND, NOR, XOR, TTL, CMOS, tristate, gate universality, noise margin, Schmitt trigger, DIP packages

This is the longest chapter, and it builds each gate from the transistor up. A single transistor driven to saturation or cutoff makes an inverter, and the buffer is two inverters in series. The multiple-input gates (AND, NAND, OR, NOR, the negative forms, exclusive-OR and exclusive-NOR) each get a truth table and an LED demonstration. The chapter then compares TTL and CMOS circuits, covers complementary, tristate and bilateral-switch outputs, shows that NAND and NOR can each build every other gate, and ends with voltage levels, Schmitt triggers, TTL-to-CMOS interfacing and DIP part numbers.

Key Points:

  • A gate with n inputs has 2 to the power n input states, so its truth table has that many rows.
  • AND is high only when all inputs are high, OR is high when any input is high, and exclusive-OR is high when the inputs differ.
  • NAND and NOR are universal: each can be wired to make NOT, buffer, AND and OR.
  • At 5 V, TTL inputs read 0 to 0.8 V as low and 2 to 5 V as high; the noise margins are 0.3 V (low) and 0.7 V (high).
  • CMOS inputs must never float, so a pullup or pulldown resistor (10 kΩ is typical) is used; CMOS draws less power at low frequency and runs from about 3 to 15 V.
  • A tristate gate has an enable input that puts the output into a high-impedance (high-Z) state.
  • The prefix 74 means commercial TTL and 54 means military grade; LS means low-power Schottky.

Memory Tip: NAND and NOR are simply AND and OR with the output inverted. For exclusive-OR, remember the word “different”: the output is high only when the two inputs differ.

Common Mistake: Leaving a CMOS input unconnected and assuming it reads low. A floating input picks up noise and gives an unpredictable output, so tie it to ground or supply through a resistor.

Important Questions:

  • Why are NAND and NOR called universal gates? Either one can be connected to build every other gate type, so a whole circuit can be made from a single gate type.
  • What does a tristate gate add to an ordinary gate? An enable input that switches the output to high impedance, so several outputs can share one wire without fighting each other.

Chapter 4: Switches

Difficulty: Easy · Key topics: hand, limit and process switches, contact materials, mercury and reed switches, snubber, wetting current, normally open and normally closed, poles and throws, contact bounce

The chapter treats the switch as the simplest binary device, either fully on or fully off. It sorts switches into hand switches, limit switches (including proximity and optical types) and process switches that respond to speed, pressure, temperature, level and flow. It then looks at contact materials, sealed mercury and reed switches, why AC arcs die out while DC arcs persist, and how a snubber helps. It explains normal states, break-before-make versus make-before-break, poles and throws, and finishes with contact bounce and the mechanical and electronic ways to remove it.

Key Points:

  • The normal state of a switch is its unactuated position; for a process switch it is the state on the shelf, uninstalled.
  • A pole is a moving contact and a throw is a stationary position it can reach, so a single-pole five-throw switch is SP5T.
  • AC arcs go out at each zero crossing (120 times a second on 60 Hz); DC arcs persist, especially with inductive loads.
  • A snubber is a capacitor and resistor in series across the contacts to reduce arcing.
  • Wetting current is the minimum current that keeps contacts clean; gold-plated contacts suit very low-current circuits.
  • Break-before-make is the common selector action; make-before-break briefly bridges neighbouring positions.
  • Bounce lasts milliseconds and can make a digital counter register several counts per press.

Memory Tip: Pole = the part that moves, throw = the places it can land. Count both and you can name any switch.

Common Mistake: Judging a process switch’s normal state from the running machine. A low-flow switch has its contacts forced open by flowing water, but its normal state, with no flow, is closed.

Important Questions:

  • What is contact bounce and why does it matter in digital circuits? Closing contacts rebound for a few milliseconds, which is harmless for a lamp but makes a counter count one press several times; a low-pass filter, a one-shot or a hysteretic multivibrator removes it.
  • What is the difference between a pole and a throw? A pole is a moving contact; a throw is one of the stationary positions each moving contact can connect to.

Chapter 5: Electromechanical Relays

Difficulty: Medium · Key topics: relay, solenoid, pull-in and drop-out current, contactor, overload heater, time-delay relay, protective relay, solid-state relay

A relay is a solenoid that moves switch contacts, so a coil drawing a fraction of a watt can control a far larger load that is electrically isolated from it. The chapter explains pull-in and drop-out current, then moves to contactors, the large relays used for motors, with their overload heaters. Time-delay relays are classified by on-delay and off-delay contacts, protective relays watch for abnormal electrical conditions and trip large breakers through current and potential transformers, and solid-state relays replace the contacts with an SCR, TRIAC or transistor.

Key Points:

  • The coil is isolated from the contacts, and the coil draws far less power than the contacts can switch.
  • Pull-in current energises the relay and a lower drop-out current releases it, which gives hysteresis like a Schmitt trigger.
  • A motor contactor switches three-phase power (for example 480 V), and series overload heaters with a normally-closed contact drop it out on overheating.
  • Time-delay relay contacts are NOTC, NOTO, NCTO and NCTC, covering on-delay and off-delay, normally open and normally closed.
  • Protective relays use current transformers (0 to 5 A secondary) and potential transformers (about 0 to 120 V) and a 125 V DC trip coil.
  • Solid-state relays are optically isolated, have no moving parts and often switch at zero crossover; they tend to fail shorted, while electromechanical relays tend to fail open.

Memory Tip: Think of a relay as a small current controlling a big one: a coil on the input side, contacts on the output side, and no electrical connection between them.

Common Mistake: Treating a solid-state relay as a safer drop-in replacement everywhere. It tends to fail shorted, leaving the load energised, whereas an electromechanical relay tends to fail open.

Important Questions:

  • What is the difference between a relay and a contactor? A contactor is simply a large relay, usually used to switch motors, with a separate auxiliary contact for the control circuit.
  • Why do solid-state relays use zero-crossover switching? Switching the load when the current is near zero avoids the inductive voltage spikes that abrupt switching would create.

Chapter 6: Ladder Logic

Difficulty: Medium · Key topics: ladder diagram, rails L1 and L2, series AND, parallel OR, permissive, interlock, seal-in contact, fail-safe design, PLC

Ladder diagrams document industrial control logic between two vertical rails, with the hot rail L1 on the left and the grounded rail L2 on the right. The chapter shows that series contacts act as AND, parallel contacts as OR and normally-closed contacts as NOT, and builds NAND, NOR and exclusive-OR from relays. It then covers permissive and interlock circuits, the Start, Stop and seal-in motor circuit with reversing time delays, fail-safe design, and the programmable logic controller, where the ladder is a program of imaginary contacts and coils.

Key Points:

  • Loads sit on the right of the rung, next to the grounded rail L2, so an accidental ground fault blows the fuse instead of energising the load.
  • Series contacts are AND, parallel contacts are OR, and a normally-closed contact is NOT.
  • Permissives are safety conditions wired in series; interlocks stop incompatible actions such as forward and reverse contactors energising together.
  • A seal-in contact in parallel with the Start button keeps the contactor energised; a normally-closed Stop button breaks the latch.
  • Open circuits (broken wires, open coils) are the most likely failures, so design so that an open circuit leaves the system in its safest state.
  • PLC inputs are opto-isolated, and PLC contacts and coils are “imaginary”, existing only in software.

Memory Tip: Series is AND and parallel is OR: current needs every switch in a series path, but only one path in a parallel set.

Common Mistake: Wiring a Stop input as normally open. A broken wire then silently disables the button, whereas a normally-closed Stop makes the same wiring failure stop the motor.

Important Questions:

  • What is a seal-in contact? An auxiliary contact of the motor contactor wired in parallel with the Start pushbutton, so the contactor stays energised after the button is released.
  • What does fail-safe design mean in a fire alarm circuit? The alarm switches are wired normally closed in series with the relay, so a broken wire sounds the alarm instead of silently disabling it.

Chapter 7: Boolean Algebra

Difficulty: Medium · Key topics: Boolean arithmetic, identities, properties, simplification rules, exclusive-OR, DeMorgan’s theorems, sum-of-products, product-of-sums

Boolean variables can only be 1 or 0, so Boolean algebra follows its own laws, which the chapter credits to George Boole (1854) and to Claude Shannon’s 1938 application of them to switching circuits. It defines Boolean addition, multiplication and complementation and matches them to OR, AND and NOT gates. Then come the identities, the commutative, associative and distributive properties, and simplification rules, with worked circuit reductions. The chapter ends with DeMorgan’s theorems and a toxic-waste incinerator example that turns a truth table into a sum-of-products or product-of-sums expression.

Key Points:

  • Boolean addition matches OR and includes 1 + 1 = 1; multiplication matches AND; subtraction and division do not exist.
  • Additive identities: A+0=A, A+1=1, A+A=A and A+A’=1. Multiplicative identities: A·0=0, A·1=A, A·A=A and A·A’=0 (A’ means NOT A).
  • A useful simplification rule is A + AB = A.
  • Exclusive-OR has no direct Boolean operator; it is written AB’ + A’B.
  • DeMorgan’s theorems: (AB)’ is not A’B’. Break only one bar per step, starting with the longest.
  • The circuit Q = AB + BC(B+C) reduces to B(A+C), cutting five gates to two.
  • Sum-of-products is written from the truth-table rows that output 1; product-of-sums from the rows that output 0.

Memory Tip: For DeMorgan, “break the bar, change the sign”: when a bar over several terms is split, AND becomes OR and OR becomes AND.

Common Mistake: Writing (AB)’ = A’B’. The correct result is A’ + B’, and the book stresses this point.

Important Questions:

  • State DeMorgan’s theorems. (A+B)’ = A’B’ and (AB)’ = A’ + B’; inverting all the inputs of an OR gives the behaviour of a NAND, and inverting all the inputs of an AND gives a NOR.
  • When is product-of-sums a better choice than sum-of-products? When the truth table has fewer rows with output 0 than with output 1. In the incinerator “sensor disagreement” circuit the output is 1 in six rows and 0 in only two, so POS is shorter.

Chapter 8: Karnaugh Mapping

Difficulty: Hard · Key topics: Venn diagrams, Gray code order, grouping, wrap-around, minterm, maxterm, sigma and pi notation, don’t-care cells, 5- and 6-variable maps

Written originally by Dennis Crunkilton, this chapter teaches the Karnaugh map as a simplification tool that beats algebra once a function has four or more inputs. It builds up from Venn diagrams and sets, reshapes the circles into a rectangular map, and links maps to truth tables and Boolean expressions. Grouping rules, 3- and 4-variable examples, minterm versus maxterm solutions, sigma and pi shorthand, don’t-care cells and the larger 5- and 6-variable maps follow, with a seven-segment decoder, a bicycle lamp bar and a magnitude comparator as examples.

Key Points:

  • Maurice Karnaugh developed the map at Bell Labs in 1953; “lowest cost” means the fewest gates with the fewest inputs per gate.
  • Map rows and columns follow Gray code order (00, 01, 11, 10), so neighbouring cells differ by exactly one bit.
  • Groups must contain 1, 2, 4, 8 or 16 cells, and the map wraps around like a cylinder.
  • A minterm (a 1 in the map) leads to sum-of-products; a maxterm (a 0) leads to product-of-sums.
  • Shorthand: f = Σm(…) lists the 1 cells and f = ΠM(…) lists the 0 cells.
  • A don’t-care cell may be treated as 1 or 0; in a BCD circuit the codes 1010 to 1111 are don’t-cares.
  • Maps work well up to six variables; beyond that the chapter recommends CAD tools such as ABEL, CUPL, Verilog and VHDL.

Memory Tip: Because the edges follow Gray code, any two neighbouring cells you circle differ in exactly one variable, so exactly one variable drops out of the term.

Common Mistake: Labelling map headers in plain binary order (00, 01, 10, 11). Neighbouring cells then no longer differ by one bit and the groups give a wrong answer.

Important Questions:

  • Why must Karnaugh map rows and columns use Gray code order? So that adjacent cells differ by only one variable, which lets a group of 2, 4 or 8 cells cancel one, two or three variables.
  • What is a don’t-care cell and how is it used? It marks an input combination that never occurs or does not matter, so you may treat it as 1 or 0, whichever gives the larger group and the simpler expression.

Chapter 9: Combinational Logic Functions

Difficulty: Medium · Key topics: combinational logic, half-adder, full-adder, decoder, encoder, demultiplexer, multiplexer

Combinational logic is defined as circuits whose output depends only on the present inputs, not on the order in which they were applied. The chapter builds the standard blocks one at a time: a half-adder from an XOR and an AND gate, a full-adder with carry-in, then decoders, encoders, demultiplexers and multiplexers. It closes with a design that shows a four-digit number on a seven-segment display using one encoder and demultiplexers, and points out that showing all digits at once would need a sequential circuit.

Key Points:

  • In a combinational circuit the output depends only on the current inputs, never on history.
  • A half-adder gives the sum with an XOR gate and the carry with an AND gate: 1 + 1 = 10 in binary.
  • A full-adder is two half-adders plus an OR gate (an XOR also works) and adds a carry-in, so adders can be chained for 2-bit or 8-bit numbers.
  • A decoder turns an n-bit code into 2 to the power n output lines; four control lines can select one of 16 devices.
  • An encoder is the reverse of a decoder; the binary-to-seven-segment example uses don’t-cares and Karnaugh maps.
  • A demultiplexer sends one input to one of many outputs; a multiplexer picks one of many inputs for a single output.

Memory Tip: Mux means many in, one out; demux means one in, many out.

Common Mistake: Mixing up a decoder and a demultiplexer. A decoder uses its code to select one output line; a demultiplexer uses its select lines to steer a data signal to one output.

Important Questions:

  • How is a full-adder built from half-adders? Two half-adders are chained and their carry outputs are combined with an OR gate (an XOR also works); the circuit adds two bits plus a carry-in.
  • What is the difference between a multiplexer and a demultiplexer? A multiplexer selects one of several inputs and sends it to one output; a demultiplexer takes one input and routes it to one of several outputs.

Chapter 10: Multivibrators

Difficulty: Hard · Key topics: feedback, bistable, monostable, astable, S-R latch, gated latch, D latch, flip-flop, J-K flip-flop, preset and clear, one-shot

The chapter starts from the idea that feeding a gate’s output back to its input creates memory, and names the three kinds of multivibrator: bistable, monostable and astable. It builds the S-R latch from cross-coupled NOR gates, adds an enable input to get the gated S-R latch, removes the invalid state with the D latch, and turns latches into edge-triggered flip-flops. The J-K flip-flop, asynchronous preset and clear inputs and the monostable (one-shot) multivibrator follow, each shown beside an equivalent relay ladder circuit.

Key Points:

  • Bistable has two stable states, monostable has one, and astable has none (it oscillates).
  • S-R latch: S=1, R=0 sets Q to 1; R=1, S=0 resets it to 0; both 0 holds the old state; both 1 is invalid.
  • D latch: when E=1 the output Q follows D, and when E=0 it holds, which makes it a 1-bit memory.
  • A flip-flop responds only at a clock edge: a triangle marks positive-edge triggering and a bubble marks negative-edge.
  • In a J-K flip-flop, J=K=1 makes the output toggle on each clock pulse; there is no such thing as a J-K latch.
  • Preset (PRE) and clear (CLR) work regardless of the clock; a retriggerable one-shot restarts its timing, a nonretriggerable one ignores new inputs while timing.

Memory Tip: A latch is level-sensitive and follows its input while enabled; a flip-flop is edge-sensitive and looks at its input only at the clock edge.

Common Mistake: Driving S and R high together on an S-R latch. That input combination is invalid, which is exactly why the D latch and the J-K flip-flop were designed.

Important Questions:

  • How does a D latch avoid the invalid state of an S-R latch? It inverts the S input to drive R and renames S as D, so S and R can never both be 1.
  • What is the difference between a latch and a flip-flop? A latch passes its input whenever it is enabled, while a flip-flop uses the clock edge as a brief enable window and captures the input only at that instant.

Chapter 11: Sequential Circuits

Difficulty: Hard · Key topics: binary count sequence, asynchronous (ripple) counter, synchronous counter, up/down counter, shaft encoder, finite state machine, Moore machine, state table · Marked INCOMPLETE by the author

The chapter shows that counting is a chain of divide-by-two stages, built from J-K flip-flops in toggle mode. Asynchronous (ripple) counters clock each stage from the previous one, and the chapter traces the false states that appear while the ripple travels. Synchronous counters tie all the clocks together and use AND gates to enable the higher bits, giving up, down and up/down counters, plus a quadrature shaft encoder. A finite-state-machine section then gives a seven-step design method. The author marks this chapter INCOMPLETE and its Counter modulus section is empty.

Key Points:

  • In a binary count each bit toggles at half the frequency of the bit below it, so the LSB toggles every step.
  • In a ripple counter the propagation delays add up, so a change such as 0111 to 1000 passes through false states.
  • In a synchronous counter all clocks are tied together and AND gates enable each higher stage, which removes the ripple.
  • Combining the up and down AND-gate chains with OR gates and an Up/Down line gives an up/down counter.
  • A quadrature encoder gives two signals 90 degrees apart, and a D flip-flop turns them into a count direction.
  • Finite-state-machine design: describe in words, draw the state diagram, encode the states, build the state table, find the flip-flop excitations, solve Karnaugh maps, wire the circuit.
  • In a Moore machine the output depends only on the current state.

Memory Tip: A ripple counter is a row of dominoes, each waiting for the one before; a synchronous counter is a drill team that moves on a single command.

Common Mistake: Reading a ripple counter’s output while it is still settling. The brief false counts are real, so strobe the output after the ripple has finished.

Important Questions:

  • Why does a ripple counter pass through false states? Each stage is clocked by the previous stage, so propagation delays accumulate and the outputs change one after another instead of together.
  • What are the steps in designing a finite state machine? Describe the behaviour, draw a state diagram, encode the states in binary, build a state table, derive the flip-flop excitations, simplify with Karnaugh maps, and wire the gates and flip-flops.

Chapter 12: Shift Registers

Difficulty: Medium · Key topics: serial and parallel loading, setup and hold time, SIPO, PISO, universal register, ring counter, Johnson counter, 4000- and 74-series parts

Also written originally by Dennis Crunkilton, this chapter explains that a shift register delays a clock-synchronised signal by one clock period per stage. It covers the four arrangements in turn: serial-in/serial-out, parallel-in/serial-out, serial-in/parallel-out and the parallel-in/parallel-out universal register. Each one is shown with real part numbers such as the SN74ALS166, 74AHC594 and 74ALS299, and with a practical use, for example reading nine keypad switches over four wires or driving eight LEDs over five. The chapter ends with ring counters, Johnson counters and the decade counters built from them.

Key Points:

  • A shift register delays its input by one clock period per stage; each stage is typically a D or J-K flip-flop.
  • Setup time and hold time must be respected; the CD4006B example uses setup 100 ns and hold 60 ns.
  • Parallel loading can be synchronous (SN74ALS166, loaded on the clock) or asynchronous (SN74ALS165, loaded by set/reset pins).
  • Serial-in/parallel-out parts such as the 74AHC594 and 74AHC595 have an output register, and cascade by feeding QH’ into the next SER input.
  • On the 74ALS299 universal register the mode lines select shift left, shift right, load or hold.
  • A 4-stage ring counter divides the clock by 4 and must be initialised at power-up.
  • A Johnson counter feeds back the complement output, so 4 stages divide by 8; the CD4017B is a decade Johnson counter with 10 decoded outputs.

Memory Tip: A ring counter with n stages has n states; a Johnson (twisted-ring) counter with n stages has 2n states.

Common Mistake: Forgetting to initialise a ring counter at power-up. It can start in any pattern, not the single circulating 1 that you intended.

Important Questions:

  • What are the four types of shift register? Serial-in/serial-out, parallel-in/serial-out, serial-in/parallel-out, and parallel-in/parallel-out (the universal shift register).
  • How does a Johnson counter differ from a ring counter? It feeds back the complement output (Q’), so a 4-stage Johnson counter divides the clock by 8 instead of 4 and gives multi-phase square waves at 50 percent duty cycle.

Chapter 13: Digital-Analog Conversion

Difficulty: Hard · Key topics: R/2nR DAC, R/2R DAC, flash ADC, digital ramp, successive approximation, tracking, slope and dual-slope, delta-sigma, resolution, aliasing

The chapter covers both directions of conversion and starts with the easier one, digital to analog. Two DAC circuits are shown: the binary-weighted R/2nR summer and the ladder-based R/2R design that needs only two resistor values. The ADC designs follow in order: flash, digital ramp, successive approximation, tracking, single- and dual-slope integrating, and delta-sigma. A final section on practical considerations deals with resolution, sample frequency, aliasing and step recovery, and the chapter ranks the ADC types without declaring a single winner.

Key Points:

  • The R/2R DAC gives the same output steps as the R/2nR DAC but needs only two resistor values, which is easier to manufacture.
  • A flash ADC uses one comparator per level plus a priority encoder: 7 comparators for 3 bits, 255 for 8 bits. It is the fastest type.
  • A digital ramp ADC uses a counter and a DAC; the conversion time depends on the input level.
  • A successive-approximation ADC tests bits from the most significant to the least, like trial-and-fit conversion.
  • A tracking ADC uses an up/down counter and suffers from “bit bobble” at the output.
  • A dual-slope ADC integrates the input for a fixed time and then discharges at a fixed rate, which cancels clock errors and averages out noise.
  • The Nyquist frequency is half the sample frequency; signals above it alias, so use a low-pass filter ahead of the ADC.

Memory Tip: Flash is one comparator per level: fast but large. Successive approximation is a game of twenty questions: each step halves the remaining range.

Common Mistake: Assuming extra bits of resolution cure aliasing. Aliasing is a sample-rate problem, so filter the signal before sampling it.

Important Questions:

  • Why is a flash ADC the fastest type, and what is its cost? All comparators work in parallel, so the delay is only propagation time, but an n-bit converter needs 2 to the power n minus 1 comparators, which grows very quickly.
  • How many bits are needed to measure a 40-foot tank to one tenth of an inch? 13 bits; a 10-bit converter gives only about 0.469 inch per step.

Chapter 14: Digital Communication

Difficulty: Medium · Key topics: busses and networks, simplex and duplex, RS-232C, RS-422A, RS-485, optical fibre, topology, ISO layers, CSMA/CD, token passing, determinism · Early-2000s hardware figures

Using a water-tank level monitor as its running example, the chapter shows why digital signals resist noise better than a 4-20 mA analog loop. It separates short-distance busses from extended-distance networks, defines simplex, half-duplex and full-duplex data flow, and compares ground-referenced and differential electrical signalling. Optical links, the four network topologies, the seven-layer ISO model and the access methods (master/slave, CSMA/CD, CSMA/BA and token passing) come next. The chapter ends on determinism and the statement that there is no perfect network for every application.

Key Points:

  • Simplex is one-way, half-duplex is two-way but one direction at a time, and full-duplex is both directions at once.
  • RS-232C is ground-referenced; RS-422A is differential, which rejects common-mode noise; RS-485 supports a multidrop bus of up to 32 nodes.
  • bps counts bits per second, while baud counts signal level changes per second.
  • Single-mode fibre (core about 5 microns) suits long runs; multimode fibre stretches pulses over distance.
  • The four topologies are point-to-point, bus, star and ring, and real networks often mix them.
  • The ISO model has seven layers, from Physical to Application; RS-232C covers only the physical layer.
  • Ethernet uses CSMA/CD and is non-deterministic; master/slave and token passing give a guaranteed maximum delay.

Memory Tip: Differential signalling uses two wires with opposite swings, so noise that hits both wires cancels at the receiver.

Common Mistake: Treating bps and baud as the same thing. They match only when each signal change carries exactly one bit.

Important Questions:

  • How does RS-422A signalling differ from RS-232C? RS-232C is ground-referenced and covers short runs at low speed, while RS-422A is differential, rejects common-mode noise and works over much longer distances.
  • What is determinism, and why is Ethernet not deterministic? Determinism is a guaranteed maximum delay. Ethernet collisions cause random retries, although this seldom matters on a lightly loaded network.

Chapter 15: Digital Storage (Memory)

Difficulty: Easy · Key topics: addresses, random vs sequential access, ROM and RAM, SRAM, DRAM, flash, core memory, PROM, EPROM, tape and disk drives · Early-2000s hardware figures

The chapter opens by asking why storage is digital, and answers that two discrete levels resist corruption far better than analog tape. It then defines addresses, random and sequential access, ROM and read-write memory, and memory capacity. Modern nonmechanical memory is built up from the D latch to static RAM, dynamic RAM and flash. The historical sections cover delay lines, Williams tubes, core and bubble memory. Read-only memory (PROM, EPROM, EEPROM) and memory with moving parts, from punched cards to hard drives, CDs and DVDs, complete the survey.

Key Points:

  • Data is stored at addresses, like mailboxes; in practice nearly all memory is random-access, even though the term RAM is used for volatile read-write memory.
  • Capacity is binary: “64 kbyte” means 65,536 bytes.
  • Static RAM stores each bit in a latch, so it is fast but low in density and power-hungry.
  • Dynamic RAM uses one capacitor and one MOSFET per cell and needs periodic refreshing; flash uses the insulated gate of a MOSFET as the storage capacitor.
  • Core memory used ferrite rings and was nonvolatile, but every read was destructive and had to be followed by a rewrite.
  • A PROM is programmed once by blowing fuses; EPROMs can be erased, electrically (EEPROM) or by ultraviolet light.
  • Tape is sequential; disks use servo-positioned heads, and CDs and DVDs store data as laser-read pits.

Memory Tip: Static RAM holds a bit in a latch, which keeps it as long as power is on. Dynamic RAM holds it as charge on a capacitor that leaks away, which is why it must be refreshed.

Common Mistake: Taking a memory size in kilobytes as a round decimal number. In binary sizing, 64 kbyte is 65,536 bytes, not 64,000.

Important Questions:

  • What is the difference between SRAM and DRAM? SRAM stores a bit in a latch and needs no refresh; DRAM stores it as charge in a capacitor, which is denser but must be refreshed periodically.
  • What is the difference between random-access and sequential-access storage? Random access goes straight to any address (like lifting a record needle); sequential access, such as tape, must pass through earlier data first.

Chapter 16: Principles of Digital Computing

Difficulty: Medium · Key topics: binary adder, look-up table, ROM, finite-state machine, stored program, ALU, control unit, fetch/execute cycle, assembly language, compilers

The final chapter says openly that it is not exhaustive, and uses the half-adder to show the limits of fixed wiring. It replaces the adder with a ROM look-up table, so that changing the function means changing stored data rather than hardware, and uses extra address lines to select addition, subtraction or comparison. Feeding ROM outputs back to its address lines through flip-flops makes a finite-state machine. From there it moves to the stored-program idea of Turing and von Neumann, the parts of a microprocessor and its fetch/execute cycle, instruction sets, assemblers, and interpreted versus compiled languages.

Key Points:

  • A half-adder’s function is fixed by its wiring; a ROM look-up table stores the truth table instead, so a new function needs only new data.
  • A 4×2 ROM can emulate a half-adder, and a 256×4 ROM can add two 4-bit numbers.
  • Feeding a ROM’s data outputs back to its address inputs through a D flip-flop makes a finite-state machine; the example counts in Gray code.
  • A processor combines read/write memory, an ALU and a Control Unit, working in a fetch/execute cycle with a program counter and an accumulator.
  • Each chip has its own instruction set, so the Intel 80386 and Motorola 68020 use different codes.
  • Interpreted languages (BASIC, FORTH) translate line by line while running; compiled languages (C, C++, FORTRAN, PASCAL) are translated in advance.

Memory Tip: A processor repeats two steps forever: fetch the instruction that the program counter points to, then execute it.

Common Mistake: Assuming machine code or assembly runs on any processor. Instruction sets belong to a chip family, so code for an Intel 8080 will not run on a Motorola 68020.

Important Questions:

  • How can a ROM act as a logic circuit? The address lines are the inputs and the stored data are the outputs, so the ROM holds the function’s truth table. A 4×2 ROM emulates a half-adder.
  • What is the difference between an interpreted and a compiled language? An interpreter translates the program line by line while it runs; a compiler translates the whole program into machine code beforehand.

How to Study This Book

The book declares no parts, so it is up to your course outline to pick the chapters. A Digital Logic Design course in BSCS or BSEE usually draws on Chapters 1 to 3 (number systems, binary arithmetic and gates), Chapters 7 to 9 (Boolean algebra, Karnaugh maps and combinational blocks) and Chapters 10 to 12 (latches, counters and shift registers). Chapters 13, 15 and 16 are the bridge to data conversion, memory and computer organization.

Read Chapters 1 and 2 even if you already know binary. Two’s complement and overflow in Chapter 2 come back in every later chapter, and exam questions on signed ranges are easy marks. Chapter 3 is the longest, and its transistor-level TTL and CMOS circuits are the part to skim if your course is purely about logic; the truth tables, universality and voltage-level sections are the ones to learn properly.

Chapters 4 to 6 (switches, relays and ladder logic) come from an industrial-control view of the same ideas. They are the natural start for BSEE and instrumentation students, and they make AND, OR, NOT and latching feel physical. If your course never mentions relays you can skim them, but Chapter 6’s series-is-AND and parallel-is-OR pictures help with Chapter 7.

Chapters 7 and 8 are the exam core. Work them as a pair: simplify a function with algebra in Chapter 7, then redo it on a Karnaugh map from Chapter 8 and compare the answers. The toxic-waste incinerator example appears in both, which makes the comparison easy. Draw many maps by hand, including ones with don’t-care cells and wrap-around groups. Then use Chapter 9 to see the same maps become adders, decoders and multiplexers.

Read Chapter 10 before Chapter 11, because counters are built from the flip-flops of Chapter 10. Be aware that Chapter 11 is marked INCOMPLETE by the author: the Counter modulus section is empty, so use your class notes for that topic. The finite-state-machine section at the end is complete and gives a seven-step method that you can reuse in exams. Chapter 12 is mostly a tour of real shift-register chips, so learn the four register types, the ring and Johnson counters, and treat the part numbers as examples.

Chapter 13 matters if your course covers ADC and DAC; learn the flash, successive-approximation and dual-slope converters and the Nyquist idea. Chapter 14 is a networking primer, so read it only if your course has a data-communication unit. Its speeds and standards (PCI, FireWire, Ethernet at 10 and 100 Mbps, token ring) reflect the early 2000s, and Chapter 15 likewise stops at floppy, ZIP and CD-W drives, with no solid-state drives or modern DDR memory. Take the concepts from both chapters and the current numbers from your lecture notes.

Know what the book does not offer. It has worked examples and short review lists in the chapters, but no end-of-chapter problem sets and no answer keys, so make your own practice questions from the examples. It also has no chapter on Verilog, VHDL or FPGAs (Chapter 8 only names them as design tools), so add those from your course if you need them.


Used In These Programs

This book is part of the Digital Logic Design course in: BS Computer Science · BS Electrical Engineering. Browse all Digital Logic books or all Computer Science books.

Who Should Read This

This book is written for undergraduate students of BSCS and BSEE who are taking Digital Logic Design, and for technicians and self-learners who want to understand how gates, latches and counters really work. It assumes basic arithmetic and a little electronics for Chapters 3 to 5; nothing else is needed. The explanations are plain and the examples come from real parts, which suits self-study. It is not the right choice if your course is built around Verilog, VHDL or FPGA design, or if you need practice problem sets with solutions. If your syllabus starts with number systems and Boolean algebra, our Number System and Boolean Algebra notes are a quick revision before Chapters 1 and 7, and Discrete Mathematics: An Open Introduction covers the logic and proof side of the same ideas. For the networking material that Chapter 14 only introduces, continue with Computer Networking: Principles, Protocols and Practice. The chapters on number systems, gates, Boolean algebra and Karnaugh maps are also useful revision for entry tests and interviews.


Applicable Universities

This book is useful for students at Pakistani universities offering BSCS and BS Electrical Engineering including Punjab University, Virtual University, COMSATS, FAST, UET, NUST, and other HEC-recognized institutions.

Official Copy of Lessons in Electric Circuits Volume IV Digital

The author gives the whole book away free on his own site, as a PDF and as chapter-by-chapter web pages. Click below to open the official page and download the PDF.

→ Visit Official Page

FAQs

Is Lessons in Electric Circuits Volume IV Digital free?

Yes. The book’s Appendix 3 gives the licence as Creative Commons Attribution 4.0 International (CC BY 4.0), so you may copy, share and adapt it as long as you credit Tony R. Kuphaldt. Older editions used the Design Science License, which the author dropped for CC BY.

Which edition is this?

The PDF front matter says Fourth Edition, last update November 6, 2021, with a copyright line of 2000 to 2023. The same book is also published as a web edition on All About Circuits.

How many chapters and exercises does it have?

There are 16 chapters and three appendices (About This Book, Contributor List and the CC BY licence). The chapters contain worked examples and short review lists, but no end-of-chapter problem sets and no answer keys.

Is it good for complete beginners?

Yes for the logic part. Chapter 1 starts from what a number is, and Chapters 3 and 7 to 10 build gates, Boolean algebra and latches step by step. Chapters 3 to 5 are easier if you know basic electronics such as voltage, current and transistors.

Does it cover Karnaugh maps, flip-flops, counters and ADC/DAC?

Yes. Karnaugh maps are in Chapter 8, flip-flops in Chapter 10, counters and state machines in Chapter 11, shift registers in Chapter 12 and ADC and DAC circuits in Chapter 13. Chapter 11 is marked incomplete by the author, so use class notes for counter modulus.

Is it still current in 2026?

The logic design chapters are timeless and still match a standard Digital Logic Design course. The hardware figures in Chapters 14 and 15 (PCI, FireWire, floppy and ZIP drives, no solid-state drives) belong to the early 2000s, and the book has no chapter on Verilog, VHDL or FPGAs, so add those from your lecture notes.

Related Books

Lessons in Electric Circuits, Volume IV: Digital gives you a free, clear path from binary numbers to a working picture of a computer, with real chips and real circuits in every chapter. Browse more Computer Science books for the rest of your semester.

Lessons in Electric Circuits, Volume IV: Digital by Tony R. Kuphaldt, copyright 2000-2023, Fourth Edition, last update November 6, 2021. Licensed under the Creative Commons Attribution 4.0 International licence (CC BY 4.0). Chapters 8 and 12 were originally written by Dennis Crunkilton, and the Finite State Machines section of Chapter 11 by George Zogopoulos Papaliakos. Official sources: https://www.ibiblio.org/kuphaldt/electricCircuits/Digital/index.html and https://www.allaboutcircuits.com/textbook/digital/

Leave a Comment