【发布时间】:2013-05-29 13:02:29
【问题描述】:
我是 VHDL 的初学者,在决定是否应该初始化信号时遇到问题...
这是一个例子:
entity tatoo is
port (
clk, reset : in std_logic;
opcode : in std_logic_vector(2 downto 0);
A, B : in std_logic_vector(3 downto 0);
F : out std_logic_vector(3 downto 0)
);
architecture toota of tatoo is
signal Q : std_logic_vector(3 downto 0);
begin
process (clk, reset) -- register for F
begin
if(reset = '1')
then F <= "0000";
elsif(Clk'event and Clk = '1')
then F <= Q;
end if;
end process;
process(opcode, A, B) -- ALU
begin
我应该在这里初始化 Q 吗? => Q
case opcode is
when "00" =>
Q <= "0000";
when "01" =>
Q <= A-B;
when "10" =>
Q <= B-A;
when "11" =>
Q <= A xor B;
end case;
end process;
非常感谢,
【问题讨论】:
标签: initialization signals vhdl alu