Shift-Register

A shift register is a chain of flip-flops wired so that each clock edge moves every stored bit one position down the chain, from one flip-flop into the next, while a new bit enters at one end and the bit that was at the far end falls off. Built from nothing more than ordinary flip-flops sharing a common clock, a shift register turns that simple chaining into one of the most widely reused building blocks in digital design — the same structure underlies serial-to-parallel data conversion, precise timing delays, and even a surprisingly compact way to count. How bits actually move through a shift register, clock edge by clock edge, looks like this:

New bit presented at the input
Waiting to enter the first flip-flop in the chain
Shift on every clock edgeAll flip-flops update simultaneously, in lockstep
Each flip-flop captures its neighbor's value
Flip-flop N takes whatever flip-flop N-1 was holding
New input bit enters the first flip-flop
Fills the position just vacated by the shift
Bit at the far end exits the chain
Falls off, available as the serial output
↻ next clock edge
Bits available in parallel or serially
Read all flip-flops at once, or read the output one bit at a time

A few things are worth knowing about why a shift register's simple bit-shuffling turns out to solve several genuinely different problems:

A shift register's defining trick is that the same hardware can load and unload data in either serial or parallel form, and that flexibility is exactly why it's the standard converter between the two formats. Loading bits in one at a time through the serial input, one per clock edge, fills the register serially; once full, reading every flip-flop's output simultaneously delivers all the bits in parallel in a single instant. Run the same structure the other direction — load every flip-flop at once through a parallel load input, then clock the register and read only the single serial output each cycle — and it unloads the same data serially instead. This dual-direction capability is precisely why shift registers sit at the boundary between a chip's wide internal data buses, which move many bits per cycle, and a narrow external serial interface, which can only move one or a few bits per wire per cycle, like a UART or SPI connection.

4-Bit Shift Register, Three Clock Edges each edge moves every bit one position down the chain Serial in before any clock edge 1 0 0 0 after clock edge 1 — new bit 0 enters, 1 shifts right 0 1 0 0 after clock edge 2 — new bit 1 enters, prior bits shift right 1 0 1 0 after clock edge 3 — original bit now exits at serial out 0 1 0 1 → serial out the bit loaded first takes exactly four clock edges to reach the far end of this four-stage register

A shift register with no external input wired in at all, and its serial output fed back around to its own serial input, becomes a pure timing-delay circuit, using the chain length itself to set the delay. Each stage adds exactly one clock cycle of delay before a bit reaches the next position, so an N-stage shift register delays whatever bit pattern is circulating inside it by exactly N clock cycles per full loop, with zero dependence on analog component tolerances the way an RC delay circuit would need. This makes a shift register a precise, fully digital way to generate a fixed delay matched exactly to the clock period — useful whenever a design needs one signal to lag another by a known, exact number of cycles rather than an approximate analog time.

Wiring a shift register's output back into its input through specific feedback logic — not simple feedback, but an XOR or XNOR combination of particular bit positions — turns it into a linear feedback shift register, a structure that generates long, pseudo-random-looking bit sequences from remarkably little hardware. A correctly chosen feedback tap pattern makes an N-bit linear feedback shift register cycle through nearly all of its 2 to the N possible states before repeating, producing a sequence that passes many statistical randomness tests despite being entirely deterministic and reproducible from the same starting value. This property is exploited constantly in chip design: built-in self-test circuits use linear feedback shift registers to generate pseudo-random test patterns for verifying logic automatically, scrambling circuits use them to whiten data before transmission, and simple hardware random-number generators often use them as a starting point before further processing.

A shift register can also implement a counter, using a structure called a ring counter or Johnson counter, which trades the compact binary encoding of a conventional counter for extreme simplicity in the decoding logic needed downstream. A ring counter circulates a single active bit around a closed loop of flip-flops, advancing its position by one stage every clock edge, so the counter's current "value" is simply which flip-flop currently holds the active bit — no binary decoding logic is needed at all to know the count, since each flip-flop's output directly indicates one specific count value. This trades the bit-efficiency of a conventional binary counter, which needs far fewer flip-flops for the same number of states, for extremely simple, glitch-free output decoding, which is valuable in control applications like sequencing a fixed series of operations where each step needs its own clean, directly available signal.

Read a shift register as bits moving in lockstep down a chain of flip-flops, not a fixed single-purpose part: that one simple mechanism, moving every stored bit one position per clock edge, is reused as a serial-to-parallel converter at chip interface boundaries, as a precise digital delay line, as the engine behind pseudo-random test-pattern generation through linear feedback, and as a decoding-free counter — four genuinely different jobs, all built from exactly the same underlying structure.

Take shift-register further

Ask the copilot about this term, or have our engineers assess it against your process.