汽车尾灯控制器的设计一、VHDL实现libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entityqcisport(clk,qd,right,left:instd_logic;rd:outstd_logic_vector(2downto0);ld:outstd_logic_vector(2downto0));endentityqc;architecturecarofqcissignalleftd:std_logic_vector(1downto0);signalrightd:std_logic_vector(1downto0);signalqdd:std_logic_vector(1downto0);signaldb:std_logic_vector(1downto0);begincontrol:process(clk,qd,left,right)beginifclk'eventandclk='1'thenifqdd=00thenqdd=10;elseqdd=(qdd-1);endif;ifrightd=01thenrightd=11;elserightd=(rightd-1);endif;ifleftd=01thenleftd=11;elseleftd=(leftd-1);endif;ifdb=01thendb=11;elsedb=(db-1);endif;endif;endprocess;proout:process(clk,qd,right,left,qdd,rightd,leftd)beginifclk'eventandclk='1'thenifqd='1'thenld=111;rd=111;caseqddiswhen00=ld=000;rd=000;when10=ld=111;rd=111;when01=ld=000;rd=000;whenothers=ld=000;rd=000;endcase;elsifqd='0'thenld=000;rd=000;endif;ifright='1'thenld=000;caserightdiswhen01=rd=001;when10=rd=010;when11=rd=100;whenothers=rd=000;endcase;endif;ifleft='1'thenrd=000;caseleftdiswhen01=ld=100;when10=ld=010;when11=ld=001;whenothers=ld=000;endcase;endif;ifleft='1'andright='1'thencasedbiswhen01=ld=111;rd=111;when10=ld=000;rd=000;when11=ld=000;rd=000;whenothers=ld=000;rd=000;endcase;endif;endif;endprocess;endcar;二、调试仿真