Skip to content
LSLab

How Do Registers Hold Processor Data?

  • Starter
  • Article
  • Ages 10+
  • 6 min read
A bare processor die with fine metallic interconnects mounted on a green circuit board.

A register is a tiny, very fast storage cell inside the processor. In a simple model, each register holds a group of bits in flip-flop circuits and loads new data at a rising clock edge while enable is active. The processor puts the numbers it needs and the result it just worked out in registers.

Contents
Registers sit inside the processor next to the calculating unit; data moves between memory and registers.
  • Memory outside the processor
  • Processor boundary (dashed)
  • Registers
  • Calculating unit

What you will learn

  • Say where registers sit and how they differ from main memory.
  • Explain why a row of flip-flops can hold bits.
  • Tell when a register takes a new value and when it keeps the old one.

Before you start

You only need to know that a bit is a binary digit with two possible values. Nothing else is needed.

What is a register and where does it sit?

A register is a small, very fast storage cell placed inside the processor. Registers are small pieces of very fast memory inside the processor, and the fastest kind of memory in the machine.

Main memory sits outside the processor. To work on data stored there, the processor first loads it into registers. When it is done, it stores the result back to memory. Registers live in a separate world from memory, so special instructions are needed to move data between the two.

The processor keeps values in a few other places too. These places include the register file, the program counter, condition flags and RAM: all of them hold values across time.

Which circuit can hold a bit?

A circuit with feedback can hold a value. A circuit that depends only on its present inputs remembers nothing. When a gate's output is wired back to an earlier input, the circuit can hold a value.

A latch does exactly that: it holds a single bit as long as power is applied. A register uses an improved latch called a flip-flop. Each flip-flop holds one bit. For a wider register, flip-flops are placed side by side, and an N-bit register is simply N D flip-flops in parallel, sharing the clock and the control signals.

So a small register like the one in the figure has four cells. A solid dot and an empty ring stand for the two different values a bit can have.

Each bit sits in its own flip-flop; the four cells share one clock line and one enable line.
  • Flip-flops, each holding one bit
  • Shared clock line
  • Shared enable line
  • Stored bit (solid dot or empty ring)

When does a register take a new value?

The register illustrated here loads new data at the rising edge of the clock. This is a rising-edge design, not a rule for every storage circuit. The clock is a signal that repeats, low and then high, and the rising edge is where it jumps from low to high. An edge-triggered circuit (a flip-flop) changes state only at a clock edge, usually the rising edge.

In this idealized diagram, the output samples the input at a rising edge. The figure assumes enable stays active. Between two rising edges the output stays put, whatever the input does. This gives every cycle exactly one well-defined update point. A level-triggered latch behaves differently: while the clock is high, its output keeps following the input, and it holds its last value only when the clock is low.

A bare D flip-flop updates on every rising edge. A useful register adds an enable signal. When enable is off, the register holds its current value. When it is on, the register loads the new value on the next rising edge.

In the ideal model with enable active, the output samples the input at each rising edge and holds it until the next; vertical guides mark the sampling times.
  • Clock signal
  • Input that changes at any time
  • Stored value
  • Rising edge of the clock

What does the processor use registers for?

The processor uses registers to hold the numbers it needs and the result it has just worked out. The two most common uses of a general-purpose register are storing the input operands of instructions and storing the results of instructions. An operand is a value that an instruction takes as input.

Follow the addition of x and y. The two values are loaded from memory into two registers. When the register file is read, a multiplexer selects which register's value flows to the arithmetic logic unit. That unit adds the two numbers, and the sum is written into a register.

There are few registers, so they hold only what is in use. Important results are moved to memory for long-term storage, because the number of registers is limited. That gives the familiar rhythm: load into registers, calculate, store to memory when the value must be kept.

This illustrative addition uses filled and empty cells for the two bit values, with weights decreasing from left to right. The result returns to a register before being stored in memory.
  • Two registers holding the two inputs
  • Calculating unit
  • Register holding the result
  • Memory

Real-world example

Picture a student adding numbers at a desk. The bookshelf behind the chair is main memory: it holds a great deal, but you must get up to reach it. A small scrap of paper right in front of you is like a register: little room, always in sight, quick to write on. You copy the two numbers onto the scrap, add them, and copy the answer into your notebook if it has to be kept. This is only an illustration; a real processor works with electric circuits, not a pencil.

Common misunderstandings

A register is a part of RAM. A register sits inside the processor and lives apart from memory, so special instructions move data between them.

A register changes the moment its input changes. A flip-flop reads its input only at the rising edge of the clock. Input changes between two edges are ignored.

Registers are for storing data for the long term. There are few registers. Results needed later are moved to memory; this compares working storage during processing and does not mean RAM retains data without power.

Frequently asked questions

How does a flip-flop differ from a latch?

A level-triggered latch lets its output follow the input for as long as the clock is high. A flip-flop is edge-triggered and changes only at the rising edge.

If enable is off, is the old data lost?

No. While enable is off, the register holds its current value and ignores the input at the rising edge.

How does the processor pick which register feeds a calculation?

A multiplexer selects which register's value flows to the arithmetic logic unit when the register file is read.

Summary

Terms in this article

English and Vietnamese terms, with the meanings used here. Hover, tap or Tab to a term with a dotted underline for an explanation as you read.

registerthanh ghi
A small, very fast memory cell inside the processor that holds the data the processor is working on.
flip-flop
A circuit that holds one bit and changes its value only at a clock edge, usually the rising edge.
latchmạch chốt
A circuit with feedback that holds a single bit as long as power is applied.
clock signalxung nhịp
A repeating signal, low and then high, that tells digital circuits when to change state.
enable signaltín hiệu cho phép
A control signal that tells a register whether to keep its value or load a new one on the next rising edge.
operandtoán hạng
A value that an instruction takes as input.
arithmetic logic unitkhối số học và logic
The part of a processor that carries out arithmetic and logic operations on its input values.

This article is not marked as viewed

Spotted something wrong or unsafe?

Tell the administrator by email. The message already has the article title and address.

Report this article
  • Macro view of a metal-pinned chip on a teal circuit board with small components behind it.
    Starter

    What Is a Microchip?

    Understand microchips, transistors and chip packages through a phone example, and distinguish a semiconductor material from a finished circuit.

    5 min read
  • An opened chip package revealing a silicon die and fine gold bond wires inside ceramic housing.
    Starter

    What Is Inside a Microchip?

    Explore the semiconductor base, transistors and chip package, and see how these parts form a component used in electronic devices.

    5 min read
  • An oscilloscope showing a high-low rectangular pulse beside a digital circuit board.
    Starter

    How Do Voltage Levels Represent Digital Signals?

    See how chips read HIGH and LOW from voltage, how logic families set thresholds, and how a transistor switch flips a level.

    5 min read
  • An exposed memory chip die with fine circuit regions and a row of gold wire-bond contacts on a board.
    Starter

    How Do Bits, Bytes and Machine Words Differ?

    Compare bits, nibbles, bytes and machine words by length, and understand why a byte has a fixed size while word length depends on the design.

    5 min read
See all articles of the topic

Sources

These sources are written for older readers. If they feel hard, read them with an adult.