Partselect
Formal Definition
Partselect gives an access
to contiguous bits of vectors.
Simplified Syntax
vector_identifier[msb:lsb];
Description
Partselect returns a part
of a vector. The range is specified by two, separated by colon, constant
expressions: the most significant bit (msb) in an expression and the least
significant bit (lsb) in an expression. Both the msb expression and the
lsb expression should be constant expressions.
The partselect operation
can be applied to any net vector type, as well as reg,
integers and time
registers. The partselect of a register declared as real
or realtime is illegal.
Partselect of a vector
should be done in the same direction as the range of the declared vector.
Examples
Example 1
reg
[3:0] vect;
vect = 4'b0001;
If the address expression
is [3:1] then returned value is 000 (vect[3:1] = 3'b000).
If the address expression
is [1:0] then returned value is 01 (vect[1:0] = 2'b01).
Important Notes
