# Problem with WHEN - ELSE

I am new in VHDL. The code below doesn't work for some reason. The D0 and D1 are switches and when I added the D1 it stopped working. clk_Centi is pointing to an LED.

end if;
end process gen_clk;

clk_Centi <= clk_Centi_i WHEN D0='0' AND D1='0' ELSE
clk_Sec_i WHEN D0='1' AND D1='0' ELSE
clk_Min_i WHEN D0='0' AND D1='1';

end Behavioral;


WHEN D0='1' AND D1='1'

• Easier way is to delete the last WHEN expression which will then cover all the bases for you. – Brian Drummond May 29 '16 at 21:42