Package STD_LOGIC_1164

 

                        -- This package shall be compiled into a design library

                        -- symbolically named IEEE.

 

                        package STD_LOGIC_1164 is

                        -----------------------------------------------------------------------------------

                        -- logic State System (unresolved)

                        -----------------------------------------------------------------------------------

                        type STD_ LOGIC is                        (  ‘U’,      -- Uninitialized

                                                                                    ‘X’,      -- Forcing Unknown

                                                                                    ‘0’,       -- Forcing   0

                                                                                    ‘1’,       -- Forcing   1

                                                                                    ‘Z’       -- High Impedance

                                                                                    ‘W’,     -- Weak     Unknown

                                                                                    ‘L’,      -- Weak     0

                                                                                    ‘H’,      -- Weak     1

                                                                                    ‘-’        -- don’t care

                                                                                 );

                        -----------------------------------------------------------------------------------

                        -- Unconstrained array of std_ulogic for use with the

                        -- resolution function

                        -----------------------------------------------------------------------------------

                        type STD_ULOGIC_VECTOR is array ( NATURAL range <> )

                              of STD-ULOGIC;

                        -----------------------------------------------------------------------------------

                        -- resolution function

                        -----------------------------------------------------------------------------------

                        -- function RESOLVED ( S : STD_ULOGIC_VECTOR )

                                                                                 return STD_ULOGIC;

                        -----------------------------------------------------------------------------------

                        -- *** industry standard logic type ***

                        -----------------------------------------------------------------------------------

                        subtype STD-LOGIC is RESOLVED STD_ULOGIC;

                        -----------------------------------------------------------------------------------

                        -- Unconstrained array of std_logic for use in declaring

                        -- signal arrays

                        -----------------------------------------------------------------------------------

                        type STD_LOGIC_VECTOR is array ( NATURAL range <> )

                              of STD_LOGIC;

                        -----------------------------------------------------------------------------------

                        -- common subtypes

                        -----------------------------------------------------------------------------------

                        subtype X01 is RESOLVED STD_ULOGIC range ‘X’ to ‘1’;

                              -- (‘X’, ‘0’, ‘1’)

                        subtype X01Z is RESOLVED STD_ULOGIC range ‘X’ to ‘Z’;

                              -- (‘X’, ‘0’, ‘1’, ‘Z;)

                        subtype UX01 is RESOLVED STD_ULOGIC range ‘U’ to ‘1’;

                              -- (‘U’, ‘X’, ‘0’, ‘1’)

                        subtype UX01Z is RESOLVED STD_ULOGIC range ‘U’ to ‘Z’;

                              -- (‘U’, ‘X’, ‘0’, ‘1’, ‘Z’)

                        -----------------------------------------------------------------------------------

                        -- overloaded logical operators

                        -----------------------------------------------------------------------------------

                        function “and” ( L : STD_ULOGIC; R : STD_ULOGIC ) return UX01;

                        function “nand” (L : STD_ULOGIC; R : STD_ULOGIC )

                                                         return UX01;

                        function “or” (L : STD_ULOGIC; R : STD_ULOGIC ) return UX01;

                        function “xor” (L : STD_ULOGIC; R : STD_ULOGIC ) return UX01;

                        function “xnor” (L : STD_ULOGIC; R : STD_ULOGIC )

                                                         return UX01;

                        function “not” (L : STD_ULOGIC ) return UX01;

                        -----------------------------------------------------------------------------------

                        -- vectorized overloaded logical operators

                        -----------------------------------------------------------------------------------

                        function “and” ( L, R : STD_LOGIC_VECTOR )

                                                         return STD_LOGIC_VECTOR;

                        function “and” ( L, R : STD_ULOGIC_VECTOR )

                                                         return STD_ULOGIC_VECTOR;

                        function “nand” ( L, R : STD_LOGIC_VECTOR )

                                                         return STD_LOGIC_VECTOR;

                        function “nand” ( L, R : STD_ULOGIC_VECTOR )

                                                         return STD_ULOGIC_VECTOR;

                        function “or” ( L, R : STD_LOGIC_VECTOR )

                                                         return STD_LOGIC_VECTOR;

                        function “or” ( L, R : STD_ULOGIC_VECTOR )

                                                         return STD_ULOGIC_VECTOR;

                        function “nor” ( L, R : STD_LOGIC_VECTOR )

                                                         return STD_LOGIC_VECTOR;

                        function “nor” ( L, R : STD_ULOGIC_VECTOR )

                                                         return STD_ULOGIC_VECTOR;

                        function “xor” ( L, R : STD_LOGIC_VECTOR )

                                                         return STD_LOGIC_VECTOR;

                        function “xor” ( L, R : STD_ULOGIC_VECTOR )

                                                         return STD_ULOGIC_VECTOR;

                        function “xnor” ( L, R : STD_LOGIC_VECTOR )

                                                         return STD_LOGIC_VECTOR;

                        function “xnor” ( L, R : STD_ULOGIC_VECTOR )

                                                         return STD_ULOGIC_VECTOR;

                        function “not” ( L  : STD_LOGIC_VECTOR )

                                                         return STD_LOGIC_VECTOR;

                        function “not” ( L   : STD_ULOGIC_VECTOR )

                                                         return STD_ULOGIC_VECTOR;

                        -----------------------------------------------------------------------------------

                        -- conversion functions

                        -----------------------------------------------------------------------------------

                        function TO_BIT ( S : STD_ULOGIC; XMAP : BIT :=‘0’

                                                                     return BIT;

                        function TO_BITVECTOR     (S : STD_LOGIC_VECTOR;

                                                                        XMAP : BIT :=‘0’) return BIT_VECTOR

                        function TO_BITVECTOR     (S : STD_ULOGIC_VECTOR;

                                                                        XMAP : BIT :=‘0’) return BIT_VECTOR

                        function TO_STDULOGIC     ( B : BIT ) return STD_ULOGIC;

                        function TO_STDLOGICVECTOR       ( B : BIT_VECTOR        )

                                                                                       return STD_LOGIC_VECTOR;

                        function TO_STDLOGICVECTOR       ( S : STD_ULOGIC_VECTOR )

                                                                                       return STD_LOGIC_VECTOR;

                        function TO_STDULOGICVECTOR    ( B : BIT_VECTOR     )

                                                                                       return STD_ULOGIC_VECTOR;

                        function TO_STDULOGICVECTOR    ( S : STD_LOGIC_VECTOR  )

                                                                                       return STD_ULOGIC_VECTOR;

                        -----------------------------------------------------------------------------------

                        -- strength strippers and type converters

                        -----------------------------------------------------------------------------------

                        function TO_X01  ( S : STD_LOGIC_VECTOR )

                                                                        return STD_LOGIC_VECTOR;

                        function TO_X01  ( S : STD_ULOGIC_VECTOR)

                                                                        return STD_ULOGIC_VECTOR;

                        function TO_X01  ( S : STD_ULOGIC     ) return X01;

                        function TO_X01  ( B : BIT_VECTOR     )

                                                                        return STD_LOGIC_VECTOR;

                        function TO_X01  ( B : BIT_VECTOR     )

                                                                        return STD_ULOGIC_VECTOR;

                        function TO_X01  ( B : BIT             ) return X01;

                        function TO_X01Z  ( S : STD_LOGIC_VECTOR )

                                                                        return STD_LOGIC_VECTOR;

                        function TO_X01Z  ( S : STD_ULOGIC_VECTOR)

                                                                        return STD_ULOGIC_VECTOR;

                        function TO_X01Z  ( S : STD_ULOGIC     ) return X01Z;

                        function TO_X01Z  ( B : BIT_VECTOR     )

                                                                        return STD_LOGIC_VECTOR;

                        function TO_X01Z  ( B : BIT_VECTOR     )

                                                                        return STD_ULOGIC_VECTOR;

                        function TO_X01Z  (B : BIT            ) return X01Z;

                        function TO_UX01  ( S : STD_LOGIC_VECTOR )

                                                                        return STD_LOGIC_VECTOR;

                        function TO_UX01  ( S : STD_ULOGIC_VECTOR)

                                                                        return STD_ULOGIC_VECTOR;

                        function TO_UX01  ( S : STD_ULOGIC     ) return UX01;

                        function TO_UX01  ( B : BIT_VECTOR     )

                                                                        return STD_LOGIC_VECTOR;

                        function TO_UX01  ( B : BIT_VECTOR     )

                                                                        return STD_ULOGIC_VECTOR;

                        function TO_UX01  ( B : BIT              ) return UX01;     

                        -----------------------------------------------------------------------------------

                        -- edge detection

                        -----------------------------------------------------------------------------------

                        function RISING_EDGE (signal S : STD_ULOGIC)

                                                                                 return BOOLEAN;

                        function FALLING_EDGE (signal S : STD_ULOGIC)

                                                                                 return BOOLEAN;

                        -----------------------------------------------------------------------------------

                        -- object contains an unknown

                        -----------------------------------------------------------------------------------

                        function IS_X ( S : STD_ULOGIC_VECTOR ) return BOOLEAN;

                        function IS_X ( S : STD_LOGIC_VECTOR ) return BOOLEAN;

                        function IS_X ( S : STD_ULOGIC      ) return BOOLEAN;

 

                        end STD_LOGIC_1164;

 

References:

1. IEEE Standard Multivalue Logic System for VHDL Model Interoperability (Std_Logic_1164), Sdt 1164-1993, IEEE, Piscataway, 1993.

2.S. Yalamanchili, “VHDL Starter’s Guide,” Prentice Hall, Upper Saddle River, 1998.

3.J. Bhasker, “VHDL Primer,” 3rd Edition, Prentice Hall, Upper Saddle River, 1998.

4.P. J. Ashenden, “The Student’s Guide to VHDL,” Morgan Kaufmann Publishers, Inc, San Francisco, 1998.

 

Back to VHDL Tutorial