3.4.7 · D1Sequential Circuits

Foundations — Registers and shift registers

2,655 words12 min readBack to topic

Before you can trust a single line of the parent note, you need to know exactly what each little symbol means and what it looks like. Below is every symbol and idea the topic silently assumes, built up one at a time. Nothing is used before it is drawn.


0. A bit — the smallest thing we store

Why do we start here? Because a register's whole job is to hold bits still and a shift register's job is to move bits sideways. If a "bit" is fuzzy in your head, every arrow later is fuzzy too.

Look at the two chalk switches: the left one is down (this is ), the right one is up (this is ). A wire in a real circuit carries a low voltage for and a high voltage for — the switch is a picture of that wire.


1. A word — several bits standing in a row

What each position is worth. Let us name the four bits of a word by a single letter with a small position number attached: . The small number is just a position index — it says which slot the bit sits in (leftmost is slot 3, rightmost is slot 0). We use a neutral letter here on purpose: it means "a bit sitting in a word", nothing more. (In §3 we will meet the letter , which will specifically mean "the bit a memory box is showing"; keeping them apart now avoids confusion later.) Reading right-to-left, each step left is worth twice as much:

The are the powers of two . This is why shifting sideways multiplies or divides by two — you will meet that idea below.


2. MSB and LSB — the two ends of a word

Why give the ends names? Because "shift" needs a direction, and directions are described by which end a bit enters and which end it falls off. "Serial In goes into the MSB" only makes sense once you know which end that is.

The pale-yellow labels mark each position's weight. Notice the weights double as you move from the LSB (right) toward the MSB (left) — that doubling is the whole reason a left shift means "".


3. The flip-flop, and its letters and

Picture the box with a wire coming in on the left labelled and a wire leaving on the right labelled . = "what I want to store", = "what I have stored". They are usually different for a moment, then the flip-flop copies into .

The parent note's atom equation

now reads in plain words: "the value I will show next is whatever is being offered at right now." The subscript "next" means after the clock ticks — which brings us to the clock. Note that (a flip-flop's stored bit) is a more specific thing than the plain we used in §1: every is a bit, but it is a bit that lives inside a memory box.


4. The subscript — labelling boxes in a row

Why an index instead of drawing every box? Because writing one line with in it once describes what happens in every flip-flop at the same time — it is a compact promise about the whole row. Without you would have to write a separate line for a 32-bit register 32 times.

The boundary problem — what feeds the first box? When each flip-flop copies its neighbour, , the very first flip-flop () has no neighbour before it: there is no . So we must define where its input comes from by hand. That extra wire is the Serial In, and the bit that drops off the far end is the Serial Out:


5. The clock — the shared heartbeat

The blue trace is the clock. The pink dots mark the rising edges — the only moments anything is allowed to change. Between edges, every is rock-steady. (The fine print of how long before an edge must be steady is Clocking and setup/hold time.)


6. The overbar and / — the algebra of switches

Why do we need these three? Because the load-enable equation on the parent page,

is built entirely from them. Here has a subscript "" that literally means ==the wire of the flip-flop== — the value that will actually be clocked in. We distinguish it from the plain (the external data line you are offering from outside) because the load-enable circuit chooses between that external and the fed-back ; the winner of that choice is what reaches the flip-flop's input, and that winner is .

Read the equation aloud with the definitions: "the flip-flop's input becomes the external when is on, or its own fed-back when is off." One of the two AND-terms is always zero, so exactly one wins. This choose-one-of-two behaviour is literally a multiplexer.


7. Serial vs Parallel — one wire or many

On the left, four bits ride four chalk wires simultaneously (parallel). On the right, the same four bits queue up and cross one wire, one per tick (serial). A shift register is the machine that converts between these two pictures — that is what UART and SPI rely on.


8. Why shifting is and — both directions

Now that place-values (§1), MSB/LSB (§2) and Serial In/Out (§4) are all defined, we can see both arithmetic effects in words.

The figure follows shifting right: the pink LSB drops off the cliff (that is the lost half), and the value walks — each step is floor-division by two, matching the parent note's Example 1. (For signed numbers you must copy the MSB back in instead of a ; that is arithmetic right shift, covered in Binary multiplication and division.)


9. Putting the symbols together

You can now re-read every headline formula of the parent note and hear words, not symbols:

The only difference between the last two lines is where flip-flop 's input comes from: its own external wire (register) versus its neighbour, with Serial In plugging the boundary hole at (shift). That single wiring choice is the entire chapter.


Prerequisite map

Bit: 0 or 1

Word: bits in a row

MSB and LSB: the two ends

Flip-flop: one-bit memory box

D input and Q output

Index i: any box in the row

Serial In and Serial Out

Clock edge: shared tick

NOT AND OR: switch algebra

Serial vs Parallel: one wire or many

Shift = times 2 or divide 2

Register

Shift register

Read it bottom-up: bits build words, words have ends, the flip-flop is the memory box with /, the clock ticks it, the index and Boolean algebra assemble many flip-flops into a register, and rewiring the inputs — plus a Serial In at the boundary — turns a register into a shift register that also multiplies and divides by two.


Equipment checklist

A bit is one of which two values?
or (off or on).
In the word , which bit is the MSB?
— the leftmost, worth the most ().
What is the numeric value of ?
.
What is a flip-flop?
A one-bit memory box (here the D-type) that stores a bit and holds it until the clock edge.
What does mean on a flip-flop and what does mean?
= value being offered as input; = value currently stored/shown as output.
What does the subscript in pick out?
The neighbouring flip-flop one position earlier — not a smaller value.
Where does the first flip-flop () get its input, since there is no ?
From the external Serial In wire; the far end's output is Serial Out.
What does the subscript in mean?
"The wire of the flip-flop" — the chosen value actually clocked in, as opposed to the external data line .
When may a flip-flop change its output?
Only at the clock edge (e.g. the rising instant); it holds otherwise.
Evaluate when .
It equals (the box holds its old value).
What does a left shift do to the number, and a right shift?
Left shift multiplies by 2 (if no overflow); right shift is floor-division by 2 (the LSB is lost).
Why must all boxes in a register share one clock?
So every bit updates in the same instant (atomically), avoiding a mixed old/new glitch word.

Connections

  • D flip-flop — the single box these symbols describe
  • Multiplexers — the choose-one-of-two behind the load-enable equation
  • Clocking and setup/hold time — the fine print of the clock edge
  • Serial communication (UART, SPI) — where serial↔parallel matters
  • Binary multiplication and division — signed vs floor right shift
  • Parent: Registers and shift registers