I looked into how IEEE defines its libraries. When I opened up stdlogic library, I saw a few truth tables that are defined as constant. I have no idea how the truth tables function. Please explain how the result is returned using truth table. Here is what I found for "AND" gate:
TYPE stdlogic_table IS ARRAY(std_ulogic, std_ulogic) OF std_ulogic;
-- truth table for "and" function
CONSTANT and_table : stdlogic_table := (
-- ----------------------------------------------------
-- | U X 0 1 Z W L H - | |
-- ----------------------------------------------------
( 'U', 'U', '0', 'U', 'U', 'U', '0', 'U', 'U' ), -- | U |
( 'U', 'X', '0', 'X', 'X', 'X', '0', 'X', 'X' ), -- | X |
( '0', '0', '0', '0', '0', '0', '0', '0', '0' ), -- | 0 |
( 'U', 'X', '0', '1', 'X', 'X', '0', '1', 'X' ), -- | 1 |
( 'U', 'X', '0', 'X', 'X', 'X', '0', 'X', 'X' ), -- | Z |
( 'U', 'X', '0', 'X', 'X', 'X', '0', 'X', 'X' ), -- | W |
( '0', '0', '0', '0', '0', '0', '0', '0', '0' ), -- | L |
( 'U', 'X', '0', '1', 'X', 'X', '0', '1', 'X' ), -- | H |
( 'U', 'X', '0', 'X', 'X', 'X', '0', 'X', 'X' ) -- | - |
);
FUNCTION "and" ( l : std_ulogic; r : std_ulogic ) RETURN UX01 IS
BEGIN
RETURN (and_table(l, r));
END "and";
"UX01" is defined as
SUBTYPE UX01 IS resolved std_ulogic RANGE 'U' TO 'Z';
I have no idea how the key word "resolved" is used. "resolved" is defined as a function in the library
FUNCTION resolved (s: std_ulogic_vector) RETURN std_ulogic;
I googled how the truth table functions for a while, but no luck to find a explanation. Please explain how the table evaluates the inputs. Thanks a lot