F
fl
Guest
Hi,
I read the following code. I know that std_logic has value '0', '1', 'Z' and
'X' etc.
There are only two values are considered below. Do you think it is an
imperfect function or not?
Thanks,
FUNCTION to_integer( x : IN std_logic) RETURN integer IS
VARIABLE int: integer;
BEGIN
IF x = '0' THEN
int := 0;
ELSE
int := 1;
END IF;
RETURN int;
END;
I read the following code. I know that std_logic has value '0', '1', 'Z' and
'X' etc.
There are only two values are considered below. Do you think it is an
imperfect function or not?
Thanks,
FUNCTION to_integer( x : IN std_logic) RETURN integer IS
VARIABLE int: integer;
BEGIN
IF x = '0' THEN
int := 0;
ELSE
int := 1;
END IF;
RETURN int;
END;