UNIHIVE

Study Hub UNIPORT CSC 284

CSC 284 · Introduction to Logic Design

Sequential circuits: latches and flip-flops

Memory in a circuit, SR latches, clocking, and the SR, JK, D and T flip-flops with their tables.

Our notes

2 min read

Sequential circuits

The output depends on the present inputs and on what happened before: the circuit has memory, called its state. A computer is a large state machine: each clock tick moves it from one state to the next.

SR latch

Two cross-coupled NOR gates (or NAND gates).

  • S = 1, R = 0: set (Q = 1).
  • S = 0, R = 1: reset (Q = 0).
  • S = 0, R = 0: hold the last value.
  • S = 1, R = 1: not allowed (both outputs forced the same).

A latch is level-sensitive: with a gated latch it follows the inputs while the enable is high.

Clocks and edges

A clock is a square wave that sets the pace. An edge-triggered flip-flop changes only at the rising (or falling) edge, so the whole system changes together and races are avoided.

The four flip-flops

  • SR flip-flop: as the latch, but clocked.
  • D flip-flop: Q(next) = D. Stores one bit; the basic cell of registers.
  • JK flip-flop: like SR but J = K = 1 toggles the output. Q(next) = JQ' + K'Q.
  • T flip-flop: T = 1 toggles, T = 0 holds. Q(next) = T ⊕ Q.

Excitation tables

To design a circuit we need the input that causes a given change. For the JK flip-flop:

  • 0 → 0: J = 0, K = X.
  • 0 → 1: J = 1, K = X.
  • 1 → 0: J = X, K = 1.
  • 1 → 1: J = X, K = 0.

Worked example

A JK flip-flop starts at Q = 0. On four clock edges the inputs are (J, K) = (1, 0), (0, 0), (1, 1), (1, 1). The outputs are 1 (set), 1 (hold), 0 (toggle), 1 (toggle).

Timing

  • Setup time: D must be steady for a short time before the clock edge.
  • Hold time: and for a short time after it.
  • Breaking these rules can leave the flip-flop metastable (undecided) for a while.

Asynchronous inputs

PRESET and CLEAR force Q to 1 or 0 at once, ignoring the clock: used to start a circuit in a known state.

Analysing a sequential circuit

  1. Write the flip-flop input equations from the gates.
  2. Build a state table: present state, inputs, next state, outputs.
  3. Draw the state diagram (circles for states, arrows for changes).

Exams usually ask

  • Draw an SR latch and explain the forbidden state.
  • Give characteristic and excitation tables; complete timing diagrams.

Common mistake

Thinking a latch and a flip-flop are the same: the latch follows its inputs while enabled, the flip-flop changes only on the clock edge.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

Practise

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All CSC 284 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.