Previous

Predefined VHDL Data Types

IEEE VHDL describes two site-specific packages, each containing a standard set of types and operations; the STANDARD package and the TEXTIO package.

The STANDARD package of data types is included in all VHDL source files by an implicit use clause. The TEXTIO package defines types and operations for communication with a standard programming environment (terminal and file I/O). You do not need this package for synthesis, and, therefore, Foundation Express does not support it.

The Foundation Express implementation of the STANDARD package is illustrated in the following example. This STANDARD package is a subset of the IEEE VHDL STANDARD package. Differences are described in the “Unsupported Data Types” section of this chapter.

   package STANDARD is
   
        type BOOLEAN is (FALSE, TRUE);
   
        type BIT is ('0', '1');
   
        type CHARACTER is (
             NUL, SOH, STX, ETX, EOT, ENQ, ACK, BEL,
             BS,  HT,  LF,  VT,  FF,  CR,  SO,  SI, 
             DLE, DC1, DC2, DC3, DC4, NAK, SYN, ETB,
             CAN, EM,  SUB, ESC, FSP, GSP, RSP, USP,
         
             ' ', '!', '"', '#', '$', '%', '&', ''',
             '(', ')', '*', '+', ',', '-', '.', '/',
             '0', '1', '2', '3', '4', '5', '6', '7',
             '8', '9', ':', ';', '<', '=', '>', '?',
         
             '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
             'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
             'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
             'X', 'Y', 'Z', '[', '\', ']', '^', '_',
         
             '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 
             'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
             'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 
             'x', 'y', 'z', '{', '|', '}', '~', DEL);
   
        type INTEGER is range -2147483647 to 2147483647;
   
        subtype NATURAL is INTEGER range 0 to 2147483647;
   
        subtype POSITIVE is INTEGER range 1 to 2147483647;
   
        type STRING is array (POSITIVE range <>) 
             of CHARACTER;
   
        type BIT_VECTOR is array (NATURAL range <>) 
             of BIT;
   
   end STANDARD;

The BIT_VECTOR data type represents an array of BIT values.

Next