Skip to content
Snippets Groups Projects
Commit 4e410d80 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Added NOT for integers.

parent 2cb309fc
No related branches found
No related tags found
1 merge request!198Clarified reading one WPFB unit into sp_subband_powers_arr2. Updated comments....
...@@ -199,6 +199,8 @@ PACKAGE common_pkg IS ...@@ -199,6 +199,8 @@ PACKAGE common_pkg IS
FUNCTION to_bool(n: IN STD_LOGIC) RETURN BOOLEAN; -- if '1' or 'H' then return TRUE else FALSE FUNCTION to_bool(n: IN STD_LOGIC) RETURN BOOLEAN; -- if '1' or 'H' then return TRUE else FALSE
FUNCTION to_bool(n: IN INTEGER) RETURN BOOLEAN; -- if 0 then return FALSE else TRUE FUNCTION to_bool(n: IN INTEGER) RETURN BOOLEAN; -- if 0 then return FALSE else TRUE
FUNCTION not_int(n: IN INTEGER) RETURN INTEGER; -- if 0 then return 1 else 0
FUNCTION to_natural_arr(n : t_integer_arr; to_zero : BOOLEAN) RETURN t_natural_arr; -- if to_zero=TRUE then negative numbers are forced to zero, otherwise they will give a compile range error FUNCTION to_natural_arr(n : t_integer_arr; to_zero : BOOLEAN) RETURN t_natural_arr; -- if to_zero=TRUE then negative numbers are forced to zero, otherwise they will give a compile range error
FUNCTION to_natural_arr(n : t_nat_natural_arr) RETURN t_natural_arr; FUNCTION to_natural_arr(n : t_nat_natural_arr) RETURN t_natural_arr;
FUNCTION to_integer_arr(n : t_natural_arr) RETURN t_integer_arr; FUNCTION to_integer_arr(n : t_natural_arr) RETURN t_integer_arr;
...@@ -704,6 +706,10 @@ PACKAGE BODY common_pkg IS ...@@ -704,6 +706,10 @@ PACKAGE BODY common_pkg IS
RETURN NOT (n = 0); RETURN NOT (n = 0);
END; END;
FUNCTION not_int(n : INTEGER) RETURN INTEGER IS
BEGIN
RETURN sel_a_b(n = 0, 1, 0);
END;
FUNCTION to_natural_arr(n : t_integer_arr; to_zero : BOOLEAN) RETURN t_natural_arr IS FUNCTION to_natural_arr(n : t_integer_arr; to_zero : BOOLEAN) RETURN t_natural_arr IS
VARIABLE vN : t_integer_arr(n'LENGTH-1 DOWNTO 0); VARIABLE vN : t_integer_arr(n'LENGTH-1 DOWNTO 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment