FPGA Center



 * Constant

 * Signal

 * Operators

 * Component

 * Concurrent Assignments

 * Process

 * Sequential Statements

 * Variable

  * User Defined Types

 

User Defined Data Types

1. Array

Sub-elements of the arrays are all the same type. Each element of an array has an index number within a range. There is one index number for one-dimensional arrays. The index number is up to the size of the array for multi-dimensional arrays.

Syntax:

type type_name is array (range) of element_name
type type_name is array (type range <>) of element_name

Example:

type RAM_D is array (2**8-1 downto 0)  of std_logic_vector(7 downto 0);
signal RAM_U : RAM_D;

2. Enumarated Data Type

Users can define data types with their names and values. So the code can be more clear. These types mostly used in finite state machines.

Syntax:

type tip ismi is (type_element, type_element, ...);

Example:

Type state_type is (idle,start,data,stop);
Signal state :state_type:= idle;

 

 

 

 project                                                                                                                                              

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