Primitive: 16-Bit Shift Register Look-Up Table (LUT) with Clock Enable
Introduction
This design element is a shift register look-up table (LUT). The inputs A3, A2, A1, and A0 select the depth of the shift register. The shift register can be of a fixed, static depth or it can be dynamically adjusted.
To create a fixed-depth shift register: Drive the A3 through A0 inputs with static values. The depth of the shift register can vary from 1 bit to 16 bits, as determined by the following formula:
Depth = (8 x A3) + (4 x A2) + (2 x A1) + A0 + 1
If A3, A2, A1, and A0 are all zeros (0000), the shift register is one bit deep. If they are all ones (1111), it is 16 bits deep.
To change the depth of the shift register dynamically: Change the values driving the A3 through A0 inputs. For example, if A2, A1, and A0 are all ones (111) and A3 toggles between a one (1) and a zero (0), the depth of the shift register changes from 16 bits to 8 bits. Internally, the depth of the shift register is always 16 bits and the input lines A3 through A0 select which of the 16 bits reach the output. The shift register LUT contents are initialized by assigning a four-digit hexadecimal number to an INIT attribute. The first, or the left-most, hexadecimal digit is the most significant bit. If an INIT value is not specified, it defaults to a value of four zeros (0000) so that the shift register LUT is cleared during configuration.
When CE is High, the data (D) is loaded into the first bit of the shift register during the clock (CLK) transition. During subsequent clock transitions, when CE is High, data shifts to the next highest bit position as new data is loaded. The data appears on the Q output when the shift register length determined by the address inputs is reached. When CE is Low, the register ignores clock transitions and retains current data within the shift register.
Two SLR16E components may be placed within the same LUT within a CLBM as long as they have the same clock, clock enable and depth selection address signals as well as the same IS_CLK_INVERTED attribute value. This allows up to 16 SRL16E components to be placed into a single CLB. Optionally, LUTNM or HLUTNMs may be placed on two SRL16E components to specify specific grouping within a LUT.
Logic Table
Inputs | Output | |||
---|---|---|---|---|
Am | CE | CLK | D | Q |
Am | 0 | X | X | Q(Am) |
Am | 1 | ↑ | D | Q(Am - 1) |
m= 0, 1, 2, 3 |
Port Descriptions
Port | Direction | Width | Function |
---|---|---|---|
CE | Input | 1 | Active-High clock enable |
CLK | Input | 1 | Shift register clock. Polarity is determined by the IS_CLK_INVERTED attribute. |
D
|
Input | 1 | SRL data input. |
Q | Output | 1 | SRL data output. |
A0 | Input | 1 | The value placed on the A0 - A3 inputs specifies the shift register
depth. Depth = (8 x A3) + (4 x A2) + (2 x A1) + A0 + 1 |
A1 | Input | 1 | The value placed on the A0 - A3 inputs specifies the shift register
depth. Depth = (8 x A3) + (4 x A2) + (2 x A1) + A0 + 1 |
A2 | Input | 1 | The value placed on the A0 - A3 inputs specifies the shift register
depth. Depth = (8 x A3) + (4 x A2) + (2 x A1) + A0 + 1 |
A3 | Input | 1 | The value placed on the A0 - A3 inputs specifies the shift register
depth. Depth = (8 x A3) + (4 x A2) + (2 x A1) + A0 + 1 |
Design Entry Method
Instantiation | Yes |
Inference | Recommended |
IP Catalog | No |
Macro support | No |
Available Attributes
Attribute | Type | Allowed Values | Default | Description |
---|---|---|---|---|
INIT | HEX | Any 16-Bit Value | All zeros | Specifies the initial contents in the shift register upon completion of configuration. |
VHDL Instantiation Template
Library UNISIM;
use UNISIM.vcomponents.all;
-- SRL16E: 16-bit shift register LUT with clock enable operating on posedge of clock (Mapped to SliceM LUT6)
-- 7 Series
-- Xilinx HDL Language Template, version 2022.1
SRL16E_inst : SRL16E
generic map (
INIT => X"0000")
port map (
Q => Q, -- SRL data output
A0 => A0, -- Select[0] input
A1 => A1, -- Select[1] input
A2 => A2, -- Select[2] input
A3 => A3, -- Select[3] input
CE => CE, -- Clock enable input
CLK => CLK, -- Clock input
D => D -- SRL data input
);
-- End of SRL16E_inst instantiation
Verilog Instantiation Template
// SRL16E: 16-bit shift register LUT with clock enable operating
// on posedge of clock (Mapped to a SliceM LUT6)
// 7 Series
// Xilinx HDL Language Template, version 2022.1
SRL16E #(
.INIT(16'h0000) // Initial Value of Shift Register
) SRL16E_inst (
.Q(Q), // SRL data output
.A0(A0), // Select[0] input
.A1(A1), // Select[1] input
.A2(A2), // Select[2] input
.A3(A3), // Select[3] input
.CE(CE), // Clock enable input
.CLK(CLK), // Clock input
.D(D) // SRL data input
);
// End of SRL16E_inst instantiation
Related Information
- See the 7 Series FPGAs Configurable Logic Block User Guide (UG474).