Professional Documents
Culture Documents
Arrays and Queues: Presented By: Dileep C P, Nishant S, Sharmila E K
Arrays and Queues: Presented By: Dileep C P, Nishant S, Sharmila E K
Presented by : Dileep C P,
Nishant S,
Sharmila E K
Content
Fixed size arrays
Packed and Unpacked arrays
Dynamic arrays
Associative arrays
Queues
Packed and Un-packed Arrays
Packed array - the dimensions declared before the data identifier name.
Unpacked array - the dimensions declared after the data identifier name.
Packed arrays can be of single bit data types (reg, logic, bit), enumerated types, and
recursively packed arrays and packed structures.
One dimensional packed array is referred to as a vector
• Vector: A vector is a multi-bit data object of reg/logic/bit declared by specifying a range
• Scalar: Scalar is 1-bit data object of reg/logic/bit declared without specifying a range
Packed arrays
A mechanism for subdividing a vector into sub-fields, which can be conveniently
accessed as array elements.
A packed array is guaranteed to be represented as a contiguous set of bits.
Un-packed arrays
Unpacked arrays can be of any data type.
Unpacked arrays shall be declared by specifying the element ranges after the identifier
name.
An unpacked array may or may not be so represented as a contiguous set of bits.
Multi dimensional array
• Multi dimensional array is still a set of contagious bits but are also segmented into
smaller groups.
Dynamic arrays
A dynamic array is one dimension of an unpacked array whose size can be set or
changed at run-time. Dynamic array is Declared using an empty word subscript [ ].
The space for a dynamic array doesn’t exist until the array is explicitly created at run-
time, space is allocated when new[number] is called.
The number indicates the number of space/elements to be allocated.
Dynamic array methods
Queue Declaration
Queue Initialization
Built-In Methods
Push and Pop
3
Thank you