交通灯控制器.doc_第1页
交通灯控制器.doc_第2页
交通灯控制器.doc_第3页
交通灯控制器.doc_第4页
交通灯控制器.doc_第5页
已阅读5页,还剩11页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

vhdleda gw48 eda/sopcfpga/cpldvhdlquartus 6.0, fpga/cpld, fpga/cpld45540 . 11 . 11. 1 . 11. 2 . 12. . 13. 1 . 12.2 . 24. . 34.1. . 34.2. jtd ctrl . 45. 3jtd time . 56. 4jtd xs . 77. 5jtd light . 98. 6 . 114 . 125 . 126 . 127 . 13/fanteral1. 45540vhdlvhdl,jtd ctrljtd timejtd xsjtd lightjtd ctrl1 khz1 hz1khz1 hzm/fanteral22.2 m = 1sb100100,m = 0m=040 sb100010b1000015sb01010040sb0011005sb100010m=1m=0a 45 40 5b 40 5 45m s 1. 100100 01100010 4022100001 533010100 4044001100 51sab10 /fanteral3 3jtd ctrljtd timejtd xsjtd light22 3 /fanteral4jtd time1hzlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jtd_ctrl isport ( clk :in std_logic;at,bt : in std_logic_vector(7 downto 0);s: out std_logic_vector(1 downto 0);end jtd_ctrl;architecture jtd of jtd_ctrl issignal q :std_logic_vector (1 downto 0);beginprocess(clk,at,bt)beginif clkevent and clk =1 thenif(at =x01)or (bt = x01) then q=q+1; atbtjtd_lightelse q=q;end if;end if;end process;s=q;end jtd;/fanteral5ablibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jtd_time isport( clk : in std_logic;m : in std_logic;s :in std_logic_vector(1 downto 0);at,bt :out std_logic_vector(7 downto 0);end jtd_time;architecture jtd_1 of jtd_time issignal ati : std_logic_vector(7 downto 0):=x01;signal bti : std_logic_vector(7 downto 0):=x01;signal art,agt,ayt : std_logic_vector(7 downto 0);signal brt,bgt,byt : std_logic_vector(7 downto 0);begin art=x45; /fanteral6 agt=x40;ayt=x05;brt=x45;bgt=x40;byt=x05;process (clk,m,s)beginif m = 1 then ati=ati; btiati=art; btibtiati=agt; btiati=ayt;end case;end if;if ati/=x01 then aif ati(3 downto 0)= 0000 thenati(3 downto 0)=1001;ati(7 downto 4)=ati(7 downto 4)-1;else ati(3 downto 0)=ati(3 downto 0)-1;ati(7 downto 4)=ati(7 downto 4);end if;end if;if bti/=x01 then bif bti(3 downto 0)=0000 thenbti(3 downto 0)=1001;bti(7 downto 4)=bti(7 downto 4)-1; /fanteral7 else bti(3 downto 0)=bti(3 downto 0)-1;bti(7 downto 4)=bti(7 downto 4);end if;end if;end if;end if;end process;at=ati;bt=bti;end jtd_1;5 /fanteral8 library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jtd_xs isport ( clk1k :in std_logic;at,bt :in std_logic_vector(7 downto 0);led1,led2,led3,led4:out std_logic_vector(3 downto 0);end jtd_xs;architecture jtd_3 of jtd_xs issignal ou1,ou2,ou3,ou4:std_logic_vector(3 downto 0);signal sl:std_logic_vector(1 downto 0);beginprocess(clk1k)beginif clk1kevent and clk1k =1 thenif sl=11 then sl=00; ledelse slou1ou2ou3ou4=at(7 downto 4);end case;end process;led1=ou1; /fanteral9 led2=ou2;led3=ou3;led4=ou4;end jtd_3;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jtd_light isport (m :in std_logic;s : in std_logic_vector(1 downto 0);abl :out std_logic_vector(5 downto 0);6 /fanteral10 end jtd_light;architecture jtd_2 of jtd_light issignal lt: std_logic_vector (5 downto 0);beginprocess (s,m)beginif m =1 then ltltltltlt=001100;end case;end if;end process;abl=lt;end jtd_2;7 /fanteral11gw48 eda/sopc588 /fan

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论