Shift Operator Examples - 2022.1 English

Vivado Design Suite User Guide: Synthesis (UG901)

Document ID
UG901
Release Date
2022-06-06
Version
2022.1 English
Table 5-6:      Shift Operator Examples

Operator

Example

Logically Equivalent To

SLL (Shift Left Logic)

sig1 <= A(4 downto 0) sll 2

sig1 <= A(2 downto 0) & “00";

SRL (Shift Right Logic)

sig1 <= A(4 downto 0) srl 2

sig1 <= “00" & A(4 downto 2);

SLA (Shift Left Arithmetic)

sig1 <= A(4 downto 0) sla 2

sig1 <= A(2 downto 0) & A(0) & A(0);

SRA (Shift Right Arithmetic)

sig1 <= A(4 downto 0) sra 2

sig1 <= <= A(4) & A(4) & A(4 downto 2);

ROL (Rotate Left)

sig1 <= A(4 downto 0) rol 2

sig1 <= A(2 downto 0) & A(4 downto 3);

ROR (Rotate Right)

A(4 downto 0) ror 2

sig1 <= A(1 downto 0) & A(4 downto 2);