FPGA Center



RECORD

Record is a composite data type which consists of different types of elements. That is the most important difference with arrays.

type record_name is record
    element_name : element_type ;
   element_name : element_type;
    . . .
end record record_name;

EXAMPLE 1:

type Register1 is (A, B, C, D);
type PROC is record
    Mnem : String (1 to 8);
    OpCode : Bit_Vector(7 downto 3);
    Op1, Op2, Rs : Register1;
end record;

EXAMPLE 2:

type AD is record
BYTE: BYTE_VEC;
IX: INTEGER range 0 to LEN;
end record;
signal X, Y, Z: BYTE_AND_IX;

DETAILED EXAMPLE :

All elements of an array should be in same type. Each element should has a uniqe name. But same element can be used in different records. If two or more elements have the same type, this elements can be defined as one type by using paranthesis. (EXAMPLE1)

the value of a record element is composite. There are two ways of assigning a value to a record:

1- Aggregate method
2- Assigning directly to the element name

 

 

                                                                                                           

    

                                                                                                                                    

 

                                                                                                                                                                                                                                                                   

Home | Fpga | VHDL | VHDL Dictionary | Digital Design | Simulation | PCB | Examples | Contact Us
Copyright © 2010 - 2013 FPGAcenter. All Rights Reserved.