Hi,
I'm fairly new to VHDL, and have a question about a simple process. In order to make this easier to address, I've created a simplified version of the process. Essentially, I have an entity with one input (std_logic_vector) and one ouput, (std_logic). All I want to do is to have my output value toggle between '0' and '1' upon ANY change in the input vector. It was my understanding, from the reading that I've done, that by placing the input value in the sensitivity list of a process, and then toggling the value in that process, that it should have this effect. For some reason it doesn't, so I must be missing something conceptually. Here's my code, any help would be greatly appreciated.
ENTITY toggle IS
PORT
( input : IN STD_LOGIC_VECTOR(7 downto 0);
enable : BUFFER STD_LOGIC);
END toggle;
ARCHITECTURE toggle_architecture OF toggle IS
BEGIN
process(input)
variable temp : STD_LOGIC := '0';
begin
if temp = '0' THEN
temp := '1';
else
temp := '0';
end if;
enable <= temp;
end process;
END toggle_architecture;
I've had many cases now where the code just doesn't seem to do what it logically suggests. If there are any good resources on the web relating to common problems or misconceptions with VHDL that anybody knows of, that would also be very helpful.
Thanks again,
Adam
I'm fairly new to VHDL, and have a question about a simple process. In order to make this easier to address, I've created a simplified version of the process. Essentially, I have an entity with one input (std_logic_vector) and one ouput, (std_logic). All I want to do is to have my output value toggle between '0' and '1' upon ANY change in the input vector. It was my understanding, from the reading that I've done, that by placing the input value in the sensitivity list of a process, and then toggling the value in that process, that it should have this effect. For some reason it doesn't, so I must be missing something conceptually. Here's my code, any help would be greatly appreciated.
ENTITY toggle IS
PORT
( input : IN STD_LOGIC_VECTOR(7 downto 0);
enable : BUFFER STD_LOGIC);
END toggle;
ARCHITECTURE toggle_architecture OF toggle IS
BEGIN
process(input)
variable temp : STD_LOGIC := '0';
begin
if temp = '0' THEN
temp := '1';
else
temp := '0';
end if;
enable <= temp;
end process;
END toggle_architecture;
I've had many cases now where the code just doesn't seem to do what it logically suggests. If there are any good resources on the web relating to common problems or misconceptions with VHDL that anybody knows of, that would also be very helpful.
Thanks again,
Adam