Shift Operators
VHDL87 did not contain operators to allow shifting or rotating. Most of
these functions were built by VHDL standard package creators. Without
the built-in operators however, overloaded shift and rotate operators were
not possible. VHDL93 includes built-in shift and rotate operators:sll
(shift left logical),srl (shift right logical),sla (shift left arithmetic),sra
(shift right arithmetic),rol (rotate left), and ror (rotate right). These op-
erators allow shifting and rotating operations for any one-dimensional ar-
ray type. These operators work as follows:
SLL — shift left logical
q <= a SLL b;
qequals ashifted left by bbits and filled on the right with the value
a’left. If bis negative then ais shifted right.
SRL — shift right logical
q <= a SRL b;
qequals ashifted right by bbits and filled on the left with the value
a’left. If bis negative then ais shifted left.
SLA — shift left arithmetic
q <= a SLA b;
qequals ashifted left by bbits and filled on the right with a(a’right).
If bis negative then ais shifted right.
SRA — shift right arithmetic
q <= a SRA b;
qequals ashifted right by bbits and filled on the left with a(a’left).
If bis negative then ais shifted left.
Appendix D: VHDL93 Updates 463