Module 3: Sequential Circuit Design · 3.1 Latches & Flip-Flops

How Silicon Remembers

This article is the first article of Module 3. It explains a problem that combinational circuits cannot solve: data storage.

A combinational circuit has no memory. Its outputs depend only on its present inputs. This article explains the cause of this limitation. It also introduces feedback, which allows circuits to store binary states.

The Toggle Switch

Consider a simple requirement: a light switch that toggles. When a user presses the push-button switch, the light turns on. When the user presses the button again, the light turns off.

You cannot express this operation as a pure combinational Boolean function. The output depends on the total count of button presses modulo 2. However, the circuit detects only the current state of the button.

The inputs do not provide the necessary historical data. Therefore, you cannot build a toggle function with combinational logic alone. Any circuit that depends on historical events requires memory.

Formally, a combinational circuit is a function:

$$f: {0,1}^n \to {0,1}^m$$

The circuit generates one fixed output pattern for each input pattern. This property helps verification, because you can test all $2^n$ input combinations.

However, this property prevents toggle operation. A toggle circuit must produce different outputs for identical inputs, based on prior operations. The circuit must retain information across events. The circuit requires memory.

Feedback

Feedback connects the output of a circuit back to an input of the same circuit.

With feedback, the output depends on external inputs and on the previous output state. All digital memory circuits use feedback. The designer must control the feedback loop to ensure stable operation and prevent unwanted oscillation.

First, examine a single inverter with its output connected to its input (Figure 1).

Inverter with feedback
Figure 1: A single inverter with feedback has no stable digital state

Assume the output is 0. The input becomes 0, which drives the output to 1. Then the input becomes 1, which drives the output back to 0.

The circuit oscillates continuously. The propagation delay of the inverter determines the oscillation period. This circuit operates as a ring oscillator and can generate a clock signal. However, it cannot store a bit.

A single inverter has only one equilibrium point, which occurs at the midpoint of its transfer curve. This midpoint is unstable. A digital memory element requires two stable states.

Two Inverters Back to Back

Now connect two inverters in a closed loop. The output of each inverter connects to the input of the other inverter (Figure 2).

Cross-coupled inverters
Figure 2: Two cross-coupled inverters provide two stable states

Name the internal nodes A and B:

  1. When node A is 0, the first inverter drives node B to 1. Then the second inverter maintains node A at 0. This state is stable.
  2. When node A is 1, the first inverter drives node B to 0. Then the second inverter maintains node A at 1. This state is also stable.

The circuit has two stable states. It remains in either state indefinitely while power is applied, consuming only leakage current.

The circuit also has a third equilibrium point where both nodes rest near half the supply voltage. This point is unstable. Electrical noise quickly forces the circuit into one of the two stable states. This unstable condition is called metastability.

A circuit with two stable states stores one bit of data. Set $A = 0$ to represent a stored 0. Set $A = 1$ to represent a stored 1. This bistable loop is the basis for digital sequential storage.

The SRAM Cell

The cross-coupled inverter pair forms the core of a Static Random-Access Memory (SRAM) cell. A standard cell adds two access transistors, as shown in Figure 3.

6T SRAM cell
Figure 3: The six-transistor SRAM cell contains two cross-coupled inverters and two access transistors

When the word line is high, the access transistors connect the internal storage nodes to the bit lines. The system can then read or write the cell data.

When the word line is low, the access transistors isolate the storage nodes. The cell then retains its stored value.

Two inverters require four transistors. With two access transistors, the circuit forms a six-transistor (6T) SRAM cell. In modern fabrication processes, a 6T cell occupies minimal silicon area, enabling high-density caches containing millions of storage cells.

Module Topics

A cross-coupled inverter loop stores a bit, but it does not provide an external control interface to change values. The remaining articles in Section 3.1 introduce controlled storage elements:

  1. The SR Latch: Adds Set and Reset control inputs to a bistable loop.
  2. The D Latch: Prevents invalid states and adds an enable control input.
  3. The D Flip-Flop: Provides edge-triggered operation for synchronous systems.
  4. JK and T Flip-Flops: Provide toggle capabilities for counters.
  5. Timing Parameters: Defines setup time, hold time, and propagation delays.

Practice Exercises

Problem 1

A combinational circuit calculates the majority function of inputs A, B, and C. Can this circuit record if input A was previously equal to 1?

Solution

No. The output of a combinational circuit depends only on the current values of A, B, and C.

When input A returns to 0 while B and C remain 0, the output returns to 0. The circuit retains no historical record of input transitions. Storing previous signal states requires a sequential memory element.

Problem 2

External drivers force both nodes of a cross-coupled inverter pair to logic 0. Then the external drivers release both nodes at the same instant. What is the behavior of the circuit?

Solution

When both nodes equal 0, both inverters attempt to drive their outputs to logic 1.

The circuit enters an unstable equilibrium near the logic threshold. Minor differences in transistor conductance and thermal noise cause one node to rise faster than the other. The faster node drives the opposite node to logic 0, which latches the circuit.

The final resting state cannot be predicted. This condition matches the invalid transition behavior of an SR latch.

Problem 3

Calculate the number of storage cells and storage transistors in an SRAM array with a capacity of 32 kilobytes (KB).

Solution

Calculate the total number of bits:

$$32\text{ KB} = 32 \times 1024 \times 8 = 262{,}144\text{ bits}$$

The array requires 262,144 memory cells.

Because each standard 6T SRAM cell contains 6 transistors, calculate the transistor count:

$$262{,}144 \times 6 = 1{,}572{,}864\text{ transistors}$$

Peripheral circuitry, such as address decoders, sense amplifiers, and write drivers, requires additional transistors.

The next article replaces the two inverters with cross-coupled logic gates to create the SR latch.

The SR Latch →