# Shift Register

Library: | Memory
Introduced: | 2.3.0
Appearance: |

## Behavior

This register consists of several stages, where each clock may lead to each stage receiving the value in the previous stage, while a new value is loaded into the first stage. The component optionally also supports parallel loads and stores to all stages' values.

## Pins

* An asterisk marks pins that exist only when the Parallel Load attribute is enabled.

West edge, top pin labeled R (input, bit width 1)
  Clear: When 1, all stages are reset to 0 (all zeroes) asynchronously; that is, as long as the clear input is 1, all values are pinned to 0, regardless of the clock input.
West edge, second pin labeled M2 [load] (input, bit width 1)
  Load: When 1 and clear is 0, all stages are loaded from data pins. When 0 or disconnected, no load occurs.
West edge, third pin labeled M1 [shift] (input, bit width 1)
  Shift: When 1 or disconnected, all stages advance with the clock trigger; but if it is 0, no advance takes place. This input is ignored if load is 1.
West edge, fourth pin labeled 1→C3 marked with triangle (input, bit width 1)
  Clock: At the instant that this is triggered as specified by the Trigger attribute, the component may advance the stages or load new values.
West edge, fifth pin labeled 1,3D (input, bit width matches Data Bits attribute)
  Data: When advancing the stages, the value found at this input is loaded into the first stage.
*West edge, other pins labeled 2,3D (input, bit width matches Data Bits attribute)
  Data: These values are loaded into all stages when the clock is triggered while the load input is 1. The topmost input corresponds to the first (youngest) stage.
East edge bottom pin (output, bit width matches Data Bits attribute)
  Output: Emits the value stored in the final (oldest) stage.
*East edge, other pins (output, bit width matches Data Bits attribute)
  Output: Emits the value stored in each stage, with the first (youngest) stage reflected on the topmost pin.

## Attributes

When the component is selected or being added, the digits '0' through '9' alter its Number of Stages attribute and Alt-0 through Alt-9 alter its Data Bits attribute.

Data Bits
  The bit width of the value stored in each stage.
Number of Stages
  The number of stages included in the component.
Parallel Load
  If yes, then the component includes inputs and outputs facilitating parallel access to all the stages' values.
Trigger
  Configures how the clock input is interpreted. The value rising edge indicates that the register should update its value at the instant when the clock rises from 0 to 1. The falling edge value indicates that it should update at the instant the clock falls from 1 to 0.
Label
  The text within the label associated with the component.
Label Font
  The font with which to render the label.

## Poke Tool Behavior

If the Parallel Load attribute is no, or if the Data Bits attribute is more than 4, then poking the register has no effect. Otherwise, clicking the component will bring keyboard focus to the clicked stage (indicated by a red rectangle), and typing a hexadecimal digit will change the value stored in that stage.

## Text Tool Behavior

Allows the label associated with the component to be edited.

Back to Library Reference