Mobile
Verilog Online Help Prev Page Prev Page
Table of Contents
Bit-select
Block Statements
Built-in Primitives
Case Statement
Continuous Assignments
Conversion Functions
Comments
Compiler Directives
Concatenations
Conditional Operator
Delays
Disable Statement
Display Tasks
Edge Sensitive Path
Expression Bit Length
File I/O Functions
Functions
Identifiers
If Statement
Integer Constants
Intra-assignment Timing Controls
Keywords
Loop Statements
Memories
min:typ:max Delays
Module Declaration
Module Instantiation
Module Path Declaration
Module Path Polarity
Net Data Types
Operators
Parameters
Part-select
PLA Modeling Tasks
Probabilistic Distribution Functions
Procedural Assignments
Procedural Continuous Assignments
Procedural Timing Control
Range Specification
Real Constants
Register Data Types
Simulation Control Tasks
Simulation Time Functions
Specify Block
State Dependent Path
Stochastic Analysis Tasks
Strengths
Strings
Structured Procedures
Tasks
Timescale System Tasks
Timing Check Tasks
UDP Declaration
UDP Instantiation
UDP State Table
Value Change Dump (VCD) File
Vectors

Part-select

Formal Definition

Part-select gives an access to contiguous bits of vectors.

Simplified Syntax

vector_identifier[msb:lsb];

Description

Part-select 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 part-select operation can be applied to any net vector type, as well as reg, integers and time registers. The part-select of a register declared as real or realtime is illegal.

Part-select 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

  • Part-select on memories, real registers, or realtime registers is illegal.

 

 

 

Powered by IXwebhosting