neocool
Member level 4
I have several questions regarding type matching in VHDL.
1. If one component outputs signed signal (i.e. 5-bit wide) and the main code accepts it as input port, how do I declare the port?
can I do it as:
or should it be inputted as std_logic_vector and then converted to signed format as:
2. If
are the input ports, then can I do that:
or signed needs a std_logic_vector type operand to be a valid statement?
or maybe I should use TYPE_NAME' :
Thanks for the help
1. If one component outputs signed signal (i.e. 5-bit wide) and the main code accepts it as input port, how do I declare the port?
can I do it as:
Code:
DATA_IN : in signed(4 downto 0);
Code:
DATA_IN : in std_logic vector(4 downto 0);
.
.
.
DATA_IN_1 <= signed(DATA_IN);
2. If
Code:
prtSIG_IN : in std_logic;
prtSIG_OUT : out signed(4 downto 0)
Code:
prtSIG_OUT <= signed(prtSIG_IN);
or maybe I should use TYPE_NAME' :
Code:
prtSIG_OUT <= signed'("0000" & prtSIG_IN);
Thanks for the help