EDA技术(机械)实验报告--汽车尾灯控制电路.docx
实验报告(计算机类)开课学院及实验室:实验时间:年月曰学生姓名学号成绩学生所在学院年级/专业/班课程名称EDA技术(机械)课程代码实验项目名称汽车尾灯控制电路项目代码七指导教师项目学分一、实验目的1 .了解VHDL语言编程方法,学会熟练运用quartus软件2 .了解汽车尾灯的运作原理3 .了解如何使用VHDL设计一个汽车尾灯控制电路二、内容与设计思想1 .用六个发光二极管模拟六个汽车尾灯(汽车尾部左右各三个),用两个开关作为转弯控制信号(一个开关控制右转弯,另一个控制左转弯)2 .要求:当汽车往前行驶时,两个开关都未接通,六个灯全灭。当汽车转弯时,若右转弯,即右转开关开通,右边三个尾灯从左至右依次亮灭,左边三个全灭;若左转弯即左转开关打开,左边三个尾灯从右到左依次亮灭,右边三个全灭。当左右开关同时接通时,六个尾灯同时亮灭。三、使用环境WinXP或Win7QUartUSii编程环境四、核心代码及调试过程汽车尾灯控制电路控制模块Iibraryieee;useieee.std_Iogic_1164.all;entitykongisport(Ieft,right:instdlogic;Ift,rit,Ir:outstd_logic);endkong;architecturekong_arcofkongisbeginprocess(left,right)variabIea:std_Iogic_vector(1downto0);begina:=left&right;caseaiswhen,00,=>lft<=,0'rit<=,0'lr<=,0,;when,10,=>lft<=,;rit<=,01;lr<=,0'when"0,=>rit<=,;lft<=,O'lr<=,0'whenothers=>rit<='1,;lft<=,;lr<=,;endcase;endprocess;endkong_arc;左转控制模块Iibraryieee;useieee.std_Iogic_1164.all;entityIftaisport(en,cIk,Ir:instd_logic;12, H,IO:outstd_logic);endIfta;architectureIft_arcofIftaisbeginprocess(cIk,en,Ir)variabIetmp:std_Iogic_vector(2downto0);beginifIr='1,theneIsifen='0'thentmp:="000"eIsifclk'eventandcIk=11,theniftmp-"000"thentmp"OO,;eIsetmp:=tmp(1downto0)&'O'endif;endif;12<=tmp(2);11<=tmp(1);10<=tmp(0);endprocess;endIft_arc;右转控制模块Iibraryieee;useieee.std_Iogic_1164.all;entityritaisport(en,elk,Ir:instd_logic;r2,r1rr:outstd_logic);endrita;architecturerit_arcofritaisbeginprocess(cIk,enfIr)variabIetmp:std_Iogic_vector(2downto0);beginifIr='1'thentmp="111,;eIsifen='O'thentmp:="000"eIsifclk,eventandcIk-,1,theniftmp="000"thentmpU100”;eIsetmp:='0'&tmp(2downto1);endif;endif;r2<=tmp(2);r1<=tmp(1);r<=tmp(0);endprocess;endritarc;总体框图:五、总结六、附录(仿真结果)SimulationWaveformsSmoLaUonnodeFsCMonJ