汽车尾灯控制电路设计
- 格式:doc
- 大小:282.00 KB
- 文档页数:5
1 汽车尾灯控制电路设计
一、设计目的
汽车尾部左右两侧都有3指示灯,要求:汽车正常运行时指示灯全灭;右转弯时,右侧的3个指示灯按照右循环顺序依次亮;左转弯时左侧的3个指示灯按照左循环的顺序依次亮;临时刹车时所有指示灯同时闪烁。
二、设计要求
利用两个输入开关来控制汽车的运行和转向
引脚自行配置
三、电路及连线设计
四、使用说明
当向左转时,扳动开关K1,则左边尾灯闪烁;当向右转时,扳动开关K2,则右边尾灯闪烁;当急刹车时,同时扳动K1,K2 则两边尾灯同时闪烁。
2 五、流程图设计
六、程序设计如下:
library ieee;
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 is
begin
process(left,right)
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';
rit<='0';
lr<='0';
when"01"=>rit<='1';
lft<='0';
lr<='0';
when others=>rit<='0';
lft<='0';
lr<='1';
end case;
end process;
end kz_arc;
3
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity timer2s is
port(clk:in std_logic;
clkout:out std_logic);
end entity timer2s;
architecture one of timer2s is
begin
process(clk)
variable counter:std_logic_vector(7 downto 0);
variable qclkout:std_logic;
begin
if clk'event and clk='1' then
if counter="11111111" then
qclkout:=not qclkout;clkout<=qclkout;counter:="00000000"; else
counter:=counter+1;
end if;
end if;
end process;
end architecture one;
library ieee;
use ieee.std_logic_1164.all;
entity lfta is
port(en,clk,lr:in std_logic;
l2,l1,l0:out std_logic);
end lfta;
architecture lft_arc of lfta is
begin
process(clk,en,lr)
variable tmp:std_logic_vector(2 downto 0);
begin
if lr='1' then
tmp(0):=NOT CLK;
tmp(1):=NOT CLK;
tmp(2):=NOT CLK;
elsif en='0' then
tmp:="000";
elsif clk'event and clk='1' then
if tmp="000" then
tmp:="001";
4 else
tmp:=tmp(1 downto 0)&'0';
end if;
end if;
l2<=tmp(2);
l1<=tmp(1);
l0<=tmp(0);
end process;
end lft_arc;
library ieee;
use ieee.std_logic_1164.all;
entity rita is
port(en,clk,lr:in std_logic;
r2,r1,r0:out std_logic);
end rita;
architecture rit_arc of rita is
begin
process(clk,en,lr)
variable tmp:std_logic_vector(2 downto 0);
begin
if lr='1' then
tmp(0):=NOT CLK;
tmp(1):=NOT CLK;
tmp(2):=NOT CLK;
elsif en='0' then
tmp:="000";
elsif clk'event and clk='1' then
if tmp="000" then
tmp:="100";
else
tmp:='0'&tmp(2 downto 1);
end if;
end if;
r2<=tmp(2);
r1<=tmp(1);
r0<=tmp(0);
end process;
end rit_arc;
七、设计总结:
5 通过几天的紧张工作,最后完成了我的设计任务——汽车尾灯控制器的设计。通过本次课程设计的学习,我深深的体会到设计课的重要性和目的性。本次设计课不仅仅培养了我们实际操作能力,也培养了我们灵活运用课本知识,理论联系实际,独立自主的进行设计的能力。它不仅仅是一个学习新知识新方法的好机会,同时也是对我所学知识的一次综合的检验和复习,使我明白了自己的缺陷所在,从而查漏补缺。希望学校以后多安排一些类似的实践环节,让同学们学以致用。
在设计中要求我要有耐心和毅力,还要细心,稍有不慎,一个小小的错误就会导致结果的不正确,而对错误的检查要求我要有足够的耐心,通过这次设计和设计中遇到的问题,也积累了一定的经验,对以后从事集成电路设计工作会有一定的帮助。在应用VHDL的过程中让我真正领会到了其并行运行与其他软件顺序执行的差别及其在电路设计上的优越性。用VHDL硬件描述语言的形式来进行数字系统的设计方便灵活,利用EDA软件进行编译优化仿真极大地减少了电路设计时间和可能发生的错误,降低了开发成本,这种设计方法必将在未来的数字系统设计中发挥越来越重要的作用。
作为电子的学生,学习EDA是相当重要的,有利于以后的工作就业,对于以后的发展也是相当有利,所以要进一步研究这门课程,好好学习。
八、参考文献:
王爱英.计算机组成与结构.北京:清华大学出版社,2001.2,
[2] 黄仁欣.EDA技术实用教程.北京:清华大学出版社,2006
[3] 曹昕燕,周凤臣,聂春燕.EDA技术实验与课程设计.北京:清华大学出版社,2006.5
[4] 杨亦华,延明.数字电路EDA入门.北京:北京邮电大学出版社,2003
[5] 彭容修,《数字电子技术基础》, 武汉,武汉理工大学出版社,2005
[6] 潘松 ,黄继业《EDA技术与VHDL》,北京,清华大学出版社,2006