Neso Academy delivers a precise and systematic breakdown of VHDL data structures, essential for managing complexity in hardware modeling. It effectively simplifies abstract grouping concepts into practical tools for efficient digital design.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Composite Data Types in VHDLAdded:
Hello everyone, welcome to NESO Academy.
In the previous lecture, we completed scalar data types. And we know a scalar type can store only one value at a time.
But in real hardware design, sometimes we need to store multiple bits together or multiple values together and even different kinds of data together. So for that, what we do? we use composite data types. Therefore, today's lecture is all about composite data types. And in this lecture, we will cover the following topics. The very first topic is composite data types. In this topic, we will understand its definition.
The second topic is arrays and the last topic is records. So let's start the lecture with the very first topic composite data types.
Composite data type stores a collection of values under a single name. Means instead of storing one value, composite data type stores multiple values at the same time. That is composite data type stores collection of values under single name. There are two main composite data types. Arrays and records where an array is a collection of elements of the same data type means an array stores collection of same data type. Now this is very important. Same data type. So can array store different data types?
No. All elements in an array must be of same data type. And there are three main arrays.
1D arrays, array of arrays and 2D arrays. We will understand them in some time. So overall an array is a collection of elements of the same data type.
Now what if I want to store different types of data under a single name? For that we will use records. So a record groups different data types under a single name. Means record stores different types of data under a single name. So if I want to store different types of data, I will use records. So I hope you understand what are composite data types which means we are done with our first topic composite data types. Let's understand the first composite data type arrays.
Let's understand different types of arrays. The very first type is 1D array or one-dimensional array. So 1D array is collection of elements of the same type arranged in a single row means one-dimensional array stores common data types but in a sequence means in a single row like a straight line. Now let's understand how to store 1D array data type inside a data object. Let's take an example.
So here I am declaring a signal named A with data type bit vector 3 down to zero. Now let's understand this keyword bit vector.
Bit means bit data type that is zeros and ones and vector means a sequence. So bit vector means a sequence of zeros and ones. Overall this signal A contains a sequence of zeros and ones. But how many zeros and ones? That is what is the length of this vector? It is defined by what is inside this parenthesis?
3 down to 0. 3 down to 0 represent the length of this vector. So 3 down to 0 means 3 2 1 0 total four values. So signal A will contain four bit values either zeros or ones. Example 1 0 0 1.
Now this keyword down to represent the descending order means this bit one is at third position. This zero is at second position. This zero is at first position and this one is at zeroth position. So overall 3 down to zero means this signal A contains four bit values where leftmost bit is at third position and rightmost bit is at zeroth position and this positioning is called index or indexing.
So I hope you understand how to declare a bit vector.
Now what if I want to store standard logic instead of zeros and ones. Now we all know what is a standard logic data type. It contains nine different values not just zeros and ones. Now let's see how to declare a standard logic vector using standard logic vector keyword. So here I am declaring a signal named B with data type standard logic vector 7 down to zero. Means this signal B will contain eight values of standard logic data type. So overall I hope you understand how to declare a one-dimensional array.
Now let's understand the second type of array which is array of arrays. As the name suggest array of arrays. So array of arrays is a composite structure where each element of an array is itself another array. In simple words, array inside another array. To understand this definition, let's take an example. But first, let's understand how to create an array of arrays using the keyword type. We have already seen that this keyword type is used to create a custom data type. So here I am creating a custom data type called memory.
Type memory is array. Now these keywords is array specifies that this data type memory is an array which means this data type memory contains multiple arrays.
And how many arrays?
0 to 3. 0 to three means 0 1 2 3 total four arrays. So this data type memory contains four arrays and each array is of standard logic vector 7 down to zero.
Means each array inside this memory data type is an 8 bit standard logic vector.
So here I have created a data type called memory which contains four multiple arrays and each array is of standard logic vector of sequence 8 bit.
Now how to use this data type? We can store this data type in any data object example signals or variables.
So here I am declaring a signal named RAM. You can use any name with the data type memory means for this signal RAM we are creating four multiple arrays and each array is of 8 bit standard logic vector means for this signal RAM we are creating four arrays RAM zero RAM one RAM two and RAM three and each array contains contains an 8 bit standard logic vector or 8 bit data.
So here we are creating four multiple arrays and each array contains 8 bit data. So array inside array. So I hope you understand why it is called as an array of arrays because it is a collection of multiple arrays.
Now let's see how to assign a fixed bit sequence inside an array. Example, if I want to assign 8 bit data inside this RAM zero array. Now let's see how to assign 8 bit data using a signal assignment operator.
First I will access this RAM zero array and assign a fixed 8 bit data. example 1 0 1 0 1 0 1 0 inside this RAM 0 array using signal assignment operator.
So I hope you understand how to assign a fixed 8 bit sequence inside any array example RAM zero.
Now what if I want to change a particular bit of this sequence example I want to change this zero of this sequence of RAM zero array how to do that let's see first I will access this RAM zero sequence and what I want to change I want to change this zero which is at second position means zeroth first and second position in this sequence of RAM zero. So I will write RAM zero to access this sequence and inside the second parenthesis I will write the index number or the bit number which is zero first and second. So I will write two which means I am accessing the second bit of the sequence of RAM zero. And what I am doing I am assigning a logic one at this position.
So what will be the updated RAM 0 sequence?
It will be 1 0 1 0 1 1 0. At the second position, we have logic one. So I hope you understand how to access a fixed bit inside an array of another array.
So I hope you understand what is array of arrays. Let's see the third type of array which is 2D array or two-dimensional array. stores elements in rows and columns using two indices just like 1D array which stores common data type in a single row. Now 2D array is collection of multiple 1D arrays which means 2D array stores common elements in rows and columns using two indices.
Let's understand this using an example.
First let's create a 2D array using the keyword type. So here I am creating a custom data type called matrix. Now similar to array of arrays these keywords is array is used to specify that this matrix is an array.
Now what I want to create three rows and four columns inside this 2D array. How to do that? Using what is inside in this parenthesis.
Now 0 to 2 represents the number of rows. 0 to 2 means 0 1 2 in total three rows. and 0 to 3 means 0 1 2 3 in total four columns. So here I am creating a 2D array named matrix with three rows and four columns. And what I want that each element inside this data type matrix should be of an integer type. For that I will write of integer.
So overall I have created a data type called matrix which contains three rows and four columns and each element inside this data type is of an integer data type. Now let's see how to use this data type. Here I am declaring a signal named M with data type matrix. Means this signal M is a 2D array which contains three rows and four columns. So three rows means row 0, row one, row two and four columns means column 0, column 1, column 2 and column 3. So I hope you understand how to create a 2D array. Now what if I want to access a particular block? Example, I want to access this block at row one and column 2. I want to access this block and assign a fixed integer value. Example 10. Now how to access this block? Let's see.
First I will access this matrix M signal and inside this parenthesis I will write the location means the row number and the column number. Row number one column number two. So I am accessing this block at row one and column two and assigning a fixed integer value 10 inside this block. using signal assignment operator.
So I hope you understand how to access a particular block inside a 2D array. Now what if if I want to access each and every block of this 2D array and assign a fixed integer value for each block.
Let's see how we can directly assign fixed integer values for each and every block.
Now each number of rows represent set of parenthesis. For three set of parenthesis we have three rows R0, R1 and R2. And inside each set we have four integers. Example 1 2 3 4 for each block inside each row. So I hope you understand how to access a full 2D array which means we are done with this topic of arrays.
Now let's understand the second composite data type records.
Now what are records? A record is a composite data type that groups different types of data under a single name. Unlike arrays which is a collection of similar data types while a record stores different data types under a single name. Now let's see how to create a record. Example if I want to create a record for student which contains role number marks and the passing status whether the student is passed or failed. Let's see how to create a record.
So here I am creating a custom data type named student using the keyword type.
Now these keywords is record specifies that this data type student is a record which contains different data types.
Example here I want this record should store role number marks and the passing status. So I will mention three fields.
The very first field is role number which is of an integer data type. The second one is marks which is of an integer data type. And third field we want as the passing status whether the student is passed or failed means two values either true or false. For that I am using boolean data type. So here I have created a record for student consisting role number marks and passing status. Now we can end this record using the keyword and record. So here I have created a data type of record. Now let's see how to use this. I am declaring a signal named S1 with data type student.
Now consider this S1 as one of the student. Now for this student I want to write his role number, marks and the passing status. Now how to assign this record? Let's see.
I will write S1 dot ro number. Now dot is the access operator means access role number from the record of student for the S1 and assign a fixed integer value example 101 using signal assignment operator. In the same way we can access marks and the passing status.
S1 dot marks means access the marks field from the student record for the student S1 and assign a fixed integer value which is 97 and the last one S1 dot pass means access the pass field from the student record for the student S1 and declaring the value as true means the student S1 one is past. So I hope record is clear to you. So a record is like a student report card which contains different data types and I hope how to assign different fields from the record is clear which means we are done with this topic of records. So in this lecture we understand that composite data types used to optimize and manage multiple values in VHDL design. Which means we are done with this lecture. I will see you in the next one. Thank you.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 views•2026-05-29
🚀 BCS613C Compiler Design | Module 1 to 5 Schema Evaluation 🔥 | VTU 6th Sem 💯 #VTU #bcs613c #exam
Pranavaa-y4y
104 views•2026-06-02











