维普资讯 http://www.cqvip.com
2O06年 汽车车灯控制系统的VHDL语言实现 郑应民 摘要:随着科学技术的进步,现代电子技术的发展,汽车电器也 可实现高度集成和精确的电路设计,降低了设计成 具有了越来越多的功能和较高的性能。本文用2O世纪8O年 代中期.Ahera和Xilinx推出的CPLD来实现汽车车灯控制系 统VHDL语言实现的初步研究,即用CPLD器件,使用VHDL 语言编程实现数字逻辑.最终实现汽车车灯控制系统的VHDL 语言数字电路部分的设计。 关键词:汽车;CPLD 中图分类号:TN791;TP312VH 文献标识码:A 文章编号:1006—7205(2006)03—Do84—o3 The Realization of Automobile’s Dynanlo’s Control System Using VHDL//ZHENG Ying-min . (Nanjing University of Science&Technology,Nanjing,210094, China) Abstract:automobile electronic device has more functions and higher performance along with the advancement of science and technology and the development of modern electronic technology. This paper dicsussed the research for realizing the dynamo’S control system of automobiles by using hte CPLD(Complex Pro- grammable Logic Device)released by Ahera and Xilinx in the middle of 1980s.i.e.used the CPLD and VHDL to realize the digital-logic and finally to realize the design of VHDL digital— circuitry of hte dynamo’S control system of automobiles. Keywords:automobile;CPLD 0 引言 当前数字电路系统的设计正朝着速度快、容量 大、体积小、重量轻的方向发展。利用大规模可编程 逻辑器件CPLD(Complex Programmable Logic Device) 进行ASIC设计,可以直接面向用户需求,根据对系统 的功能要求自上而下地逐层完成相应的描述、综合、 优化、仿真与验证,直到生成元器件。目前,系统级的 仿真工具也已出现.这样可以大大地缩短系统的设计 周期,增加可靠性,提高产品竞争能力。采用Ahera和 Xilinx公司的可编程逻辑器件,并配以开发软件可在 计算机上进行各种电路设计和修改,并可对电路特性 进行仿真模拟,最后将设方案下载到该器件中,这样 本,提高了设计效率和电路的可靠性。本文通过一个 汽车车灯控制系统的设计实践,介绍了VHDL语言的 具体设计应用。 1 系统功能及要求 汽车上有一转弯控制杆,此杆有三种状态:中间 位置时汽车不转弯,向上位置时汽车左转,向下位置 时汽车右转。汽车转弯时相应的尾灯和头灯均闪烁, 当应急开关合上时,头灯尾灯均闪烁。汽车刹车时,2 个尾灯发出一直亮的信号。如果汽车刹车时正在转 弯,则相应的转弯闪烁信号不受影响。 2逻缉抽象 由要求转换成真值裹 注:断一灯不亮;闪一灯闪烁;通一灯一直亮 3由真值表得出逻缉表达式 E(断)=(C and D)or((not B)and(not C)); 维普资讯 http://www.cqvip.com
第3期 技术研究・汽车车灯控制系统的VHDL语言实现 E(闪)=(B and(not C))Or(C and(not D)); E(通)=0; F(断)=(C and D)OR((not B)and(not D)); F(闪)=((n0t C)and D)Or(B and(not D)); F(通)=0; G(断)=(C and D)or((not A)and(not B)and(not C)); G(闪)=(C and(not D))or((not A)and B and(not C)); G(通)=A and(not C); H(断)=(C and D)or((not A)and(not B)and(not D)); H(闪)= not C)and D)or((not A)and B and(not D)); H(通)=A and(not D); 4 VHDL语言实现(源程序注释) library IEEE~定义IEEE库,使用sfd—log- ic一1 1 64和std—logic—unsigned use IEEE.std_logic-l 164.all;一包集合 use IEEE.std—.1ogic—.unsigned.all; entity autolight is一定义实体autolight port(A.in STD—LOGIC; C:in STDLOGIC; —B.in STDLOGIC; —D.in STD—LOGIC; E.out STD—LOGIC; F.out STD—LOGIC; G:out STDLOGIC; —H:out STD—LOGIC); 一说明:定义器件的输入输出口字母用大写。A、 B、C、D对应上述四个开关,信号为输入;E、F、G、H对 应上述前后车灯,信号为输出。 end autolight; architecture autolight—arch of autolight is一构造 体说明 singal el,e2,e3,f1, ,f3,g1,g2,g3,h1,h2,h3,clkk, sehstd—.1ogo; signal controle,controlf,controlg,controlh:std—logic —vector(2 downto 0); 一说明:定义器件内部信号口的字母用小写。e1 对应E(断),e2对应E(闪),e3对应E(通)。fl、f2、t3、gl、 g2、g3、h1、h2、h3同理。 component clk一元件clk以产生闪烁信号 port(clkin:in std—logic;clkout:out std—logic);——脉 冲(为方波) end component; component OS~元件OS相当于晶体振荡器 port(osout:out std-lo百c);一产生约8mhz脉冲 end component; begin ul:OS port map(clkk);一调用OS产生信号clkk u2:clk port map(clkk,se1);一调用clk产生信号 sel用于闪烁 --light e一产生e1,e2,e3,f1, ,f3,gl,g2,g3 el<=((not b)and(not c))or(c and d);hl,h2,h3信号 e2<=(b and(not c))or(c and(not d));一如el=l则 左头灯不亮 e3<=~0;一如e2=l则左头灯闪烁,如e3=l则左 头灯一直亮 一light f一同一时刻e1、e2、e3只会有一个为1 f1<=((not b)and(not d))or(c and d); f2<=((not c)and d)or(b and(not d)); t3<= 0 : 一一light g gl<=((not a)and(not b)and(not c))or(c and d); g2<=((not a)and b and(not c))or(c and(not d)); g3<=a and(not c); ————light h h l<=((not a)and(not b)and(not d))or(c and d); h2<=((not C)and d)or((not a)and b and(not d)); h3<=a and(not d); ——contI。ol signal--controle controlf controlg controlh controle<=e1&e2&e3;一为位失量(2 downto 0),该 位变量值 controlf<=fl&f2&f3;一等于e1、e2、e3组合,只可 能为100、010 controlg<=g 1&g2&g3;00 1之一 controlh<=h 1&h2&h3; —-——light signal offlash is clkin2 e<= 0 when controle=”O01”else一一on 如controle=100则左头灯不亮 sel when controle=”010”else一一flash 如controle=010则左头灯闪烁 1 :一一off 如controle=O01则左头灯一直亮 f<= 0 when controlf=”001”else一一on sel when controlf=”010”else一一flash 1 :一一off g<= 0 when controlg=”001”else--on sel when controlg=”010”else一一nash 1 :一一off h<= 0 when controlh=”001..else一一0n 维普资讯 http://www.cqvip.com
中国农机化・CHINESE AGRICULTURAL MECHANIZATION 2006年 … —c………… … 一 …一 一 … …一 简述三维设计时代的徒手草图 朱春耕,蒋洪奎,金才富 摘要:工业设计正进入3D—CAD时代,徒手草图因其独特的优 sign.This text inquired the method to draw the barehanded 点,在现代设计中的作用不仅没有减弱反而加强了。本文探讨 sketch,and the engineering application of the barehanded sketch, 了草图绘制方法、草图的工程应用、草图思维及其养成等。 the barehanded sketch thinking of method and it develops etc.. 关键词:6t手草图;概念设计;设计与制造;草图思维;制图教学 Keywords:sketch;concept design;desing and manufacturing; 中圈分类号:TB47;J100.9 sketch thought;graphics teaching 文献标识码:B 0 引言 文章编号:1006—7205(2006)03—0086—03 由于计算机辅助设计与制造(CAD/CAM)在工程 The Barehanded Sketch in the 3D—CAD Times//ZHU Chun- 中广泛应用。手工绘图图纸在工程应用中的比例越来 geng,JIANG Hong—kui,JIN Cai—fu 越小。在工程教学中,计算机辅助设计与制造软件的 (Zhejiang Nomal University,Jinhua,321019,China) 快速发展成了各工程课程教学改革的重要动因,教师 Abstract:,I1le industry design is entering the 3 Ds-CAD for 和学生开始学习和运用各种CAD系统。他们渐渐疏 ages,because the barehanded sketch have special advantage,the 于手工设计与绘图,计算机代替了纸笔,直接在电脑 function of the barehanded sketch is strengthened in modem de- 屏幕上完成方案设计、造型设计、工程计算、工程图 sel when contorlh=”010”else一-flash architecture clkarch of clk is —.1 ;--off signal clk:STD—.LOGIC; end autolightsignal counter:stdlogic_arch;一结束构造体autolight—arch ——vector(24 downto 0); 5管脚锁定文件说明 begin 用户可根据使用情况自行定义管脚锁定文件。 clk0ut<:c0unter(24); 这里将用EDA实验板上资源(跳线,开关按键,数码 process(CLKin) 管,LED指示灯,蜂鸣器等)与xilinx xc9572芯片管脚 begin 相连,使用者可通过对按键和开关的操作加上指示灯 if CLKin= 1’and CLKin event then 和数码管的显示来判断程序是否正确。 COUNTER<=COUNTER+1; 本系统使用xc9572中p33、p34、p35、p36作为输 end if; 人端,对应程序中A、B、C、D,在EDA实验板上对应跳 end process; 线的最左边四个。使用p29、p28作为左右头灯,对应 end clk—.arch; ELD发光管最左边两个。使用p40、p42作为左右尾 7 总结 灯,对应LED发光管最右边两个。 VHDL作为一种硬件描述语言,以其灵活、完善 6元件clk说明 和强大的功能在全世界得到了广泛的运用。而使用 library IEEE; CPLD器件设计汽车车灯控制系统的硬件可使其更 use IEEE.std—logic_I 1 64.all; 加小型化、集成化,可靠性得到有效得提高。 use IEEE.std参考文献: —.1ogic_unsigned.all; entity clk is—clk的作用是分频以产生闪烁信号 【1】Kevin SkahiU[美】.可编程逻辑系统VHDL设计技术【M】.东南 port( 大学出版社.1998:59—60. clkin:in std_logic; clkout:out STD—.LOGIC); 来稿日期:2oo5年9月26日 end clk; 郑应民南京理工大学210o94南京市