10-02-2018, 08:01 AM
Frank, boolean type is almost essential in VHDL. Whenever you say something like B <= (S = X"25"); then B is boolean. Conversion from SL to boolean is trivial:
B <= (SL = '1');
From boolean to SL is a bit clumsy unless you use a function:
Function to_std_logic(X: in Boolean) return std_logic is
variable ret : std_logic;
begin
if x then ret := '1'; else ret := '0'; end if;
return ret;
end to_std_logic;
This can be included in each module or put in a package or library.
You then say:
SL <= to_std_logic(boolean);
B <= (SL = '1');
From boolean to SL is a bit clumsy unless you use a function:
Function to_std_logic(X: in Boolean) return std_logic is
variable ret : std_logic;
begin
if x then ret := '1'; else ret := '0'; end if;
return ret;
end to_std_logic;
This can be included in each module or put in a package or library.
You then say:
SL <= to_std_logic(boolean);
www.borinsky.co.uk Jeffrey Borinsky www.becg.tv







