Design

It is imperative to know and understand the design of your machine so that you can inspect data sheets properly and select appropriate parts. This is why the first thing to do is always to fully design your machine so that you have logic diagrams: combine the resulting combinational logic with a register and a clock for the main sequential circuit, then add any necessary combinational circuit for decoding/encoding states for whatever you need each state to do concretely. The full pipeline for how to design a finite state machine: /writeups/fsm-design

state table logic circuit

This circuit is enough for flashing LEDs and displaying the binary-encoded states, but to implement something more practical, an additional combinational circuit can be used to decode these states and drive the appropriate segments of a single-digit 7-segment display, showing a human-readable number for each state rather than pure binary. This is the decoder.

truth table decoder
  • BCD to 7-segment decoder

Reading Data Sheets & Selecting Components

At first, data sheets can seem overwhelming and confusing to read, but it’s important to keep in mind that they’re simply very descriptive, it’s not a matter of taking in all the information at once, but of looking for the details that match your specifications, one at a time, in a descending hierarchical order. First focus on the description of the component, then the pinout, tables, logic schematics… all while keeping track of maximum and recommended operating conditions: voltage, current, temperature, and so on, making sure it’s compatible with the rest of your circuit. There are also smaller variables to consider, such as whether the active state is high or low (which decides whether you need a common anode or common cathode display), or whether a flip-flop is rising- or falling-edge triggered.

It comes down to matching abstract layers first, then progressively matching lower-level details pinout, operating conditions, logic until you land on a complete match.

In this example, the clock is an astable multivibrator (for an explanation on how they work: /writeups/astable-multivibrator). A NE555P is used as the timer, an SN74LS90 as the decade counter, and an SN74LS47 as the BCD-to-7-segment decoder for the display. The decade counter is falling-edge triggered, and the decoder is active-low (meaning its active output is LOW) which means the display needs to be common anode, not common cathode.

With all the parts selected, it’s time to wire it up physically.

Wiring Components

When wiring digital circuits for the first time especially coming from analog it helps to make the mental shift toward thinking primarily in terms of boolean TTL HIGH/LOW logic, and pushing voltage and current more into the background of your thinking (while still, of course, keeping them in mind). The main difference between a logic circuit and a real circuit is the addition of a power supply. Every IC needs power through its VCC and GND pins; beyond that, use the power rails for TTL logic on the rest of the pins. Something else that logic diagrams don’t cover is the external circuitry some components require, such as RC (resistor-capacitor) timing covered further below but this is generally well described in the data sheet, complete with examples, and easy to follow. On breadboards in particular, it can be tricky to transfer a schematic directly onto the board, but the trick is to think in terms of electrically common components and nodes rather than a strict 1:1 mapping of the schematic’s “wires.” Think flexibly and be creative.

RC Timing in the Clock

As mentioned, RC timing is one thing not covered by the digital logic itself. Timers tend to rely on this external circuitry to determine pulse length, and data sheets usually provide formulas for finding the resistance and capacitance needed for a given frequency or high/low time. In this example, f = 1.44 / ((A + 2B)·C) is used, where A is the resistance of resistor A, B is the resistance of resistor B, and C is the capacitance (in farads), this lets you calculate the values needed to get a specific pulse frequency out of the NE555 timer. In this example A = 1000, B = 5100, C = 0.0001 for f = 1.28Hz

RC Power-On Reset (POR)

Resetting matters because it keeps flip-flops from starting on random values, making their behavior predictable. A simple but effective way to reset flip-flops on power-up is a single capacitor and a single resistor. The idea: while the capacitor charges, reset stays HIGH; once the capacitor finishes charging, current stops flowing through it and the reset pin settles to LOW, grounded. When power is removed, the capacitor discharges, ready to repeat the cycle. The RC time constant can be used for calculating how long the capacitor will take to charge and consequently stop conducting: τ = RC. Five time constants is roughly equal to 100% so calculate with τ = 5RC

In this example R = 1kOhm, C = 10uF

τ = 5*1000*0.00001 = 0.05s → 50ms

Notice how important the resistor is here, beyond just timing.

  • Proper POR

Without resistor, initial output will be random:

  • Bad POR

This happens because of Kirchhoff’s Voltage Law (KVL), any two points connected by a direct wire (zero resistance) must sit at the same voltage. If you replace the resistor with a jumper straight to GND, you’re tying the reset pin’s node directly to ground. With no resistance in that path, there’s no voltage drop across it so the reset pin is forced to 0V, and it drags down the parallel path that’s supposed to be at 5V while the capacitor is charging.