Mode-select inputs tell a multi-function register which job to do at the next edge. In a universal shift register, two inputs S1 S0 pick one of four modes:
00: hold01: shift right10: shift left11: parallel load
In hardware, the mode inputs are the select lines of the 4:1 multiplexer in front of every flip-flop. Every MUX gets the same S1 S0, so all bits perform the same operation at once.
Two mode bits allow 4 operations; in general k mode bits allow 2ᵏ. A simple load enable register is the one-bit case: L chooses between hold and load.
Like every synchronous input, the mode only matters at the rising edge. It may change freely between edges.
Designing the mode logic: when a register is controlled by higher-level signals ("load when X, otherwise shift when Y"), write S1 and S0 as functions of those signals so that each situation produces the right code.
| S1 | S0 | ||
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |