2、右拐、故障和刹车。4个输入信号为:3.参考VHDL源程序(1)主控制模块 说明:此程序为系统主控制模块。当左转时,lft信号有效;右转时,rit信号有效;当左右信号都有效的时,lr有效。library ieee; rit<='0';use ieee.std_logic_1164.all;entity kz is port(left,right:in std_logic; lft,rit,lr:out std_logic);end kz;architecture kz_arc of kz isbegin process(left,rig
3、ht) variable a:std_logic_vector(1 downto 0); begin a:=left&right; case a is when"00"=>lft<='0';----------正常 rit<='0'; lr<='0'; when"10"=>lft<='1';----------左转 lr<='0'; when"01"=>rit<='
4、1';-----------右转 lft<='0'; lr<='0'; when others=>rit<='1';---------STOP lft<='1'; lr<='1'; end case; end process;end kz_arc; 当左右信号都有效时,输出为全“1”(2)左边灯控制模块说明:此模块的功能是当左转时控制左边的3个灯,libraryieee;useie