I'm trying to write some code to simulate a circuit with two tri-state buffers and a pull-up resistor in VHDL. Below is my code:
library ieee;
use ieee.std_logic_1164.all;
entity PullUpResistor is
port (
A, S, B, T : IN std_logic; -- select one of these four inputs
TriOut : OUT std_logic -- output (no ";" after last port)
);
end entity PullUpResistor;
architecture behavioral of PullUpResistor is
begin
process(A, S, B, T) is
when (S = '1') and (T = '0') => TriOut <= A;
when (S = '0') and (T = '1') => TriOut <= B;
when (S = '0') and (T = '0') => TriOut <= 'H';
when (S = '1') and (T = '1') => TriOut <= 'X';
end process;
end architecture behavioral;
I'm getting a compiler error near "when": syntax error
on line 14 which is the when (S = '1') and (T = '0') => TriOut <= A;
line. I can't for the life of me figure out what the syntax error is.
Any help would be greatly appreciated.
Thanks.