基于vhdl的交通灯控制系统设计--毕业论文内容摘要:

tdxPl:buffer std_logic_vector(3 downto 0)。 倒计时显示东西方向人行道所亮灯剩余时间。 tnbh:BUFFER STD_LOGIC_VECTOR(6 DOWNTO 4)。 tnbl:BUFFER STD_LOGIC_VECTOR(3 downto 0)。 倒计时显示南北方向所亮灯剩余时间。 tnbph:buffer std_logic_vector(8 downto 4)。 tnbpl:buffer std_logic_vector(3 downto 0))。 倒计时显示南北方向人行道所亮灯剩余时间。 END count。 architecture beh of count is signal light:std_logic_vector(13 downto 0)。 signal tdx:std_logic_vector(6 downto 0)。 signal tdxp:std_logic_vector(8 downto 0)。 signal tnb:std_logic_vector(6 downto 0)。 signal tnbp:std_logic_vector(8 downto 0)。 signal s:std_logic_vector(3 downto 0)。 亮灯 状态。 constant dxnbgth:std_logic_vector(6 downto 4):=011。 constant dxnbgtl:std_logic_vector(3 downto 0):=0000。 设置绿灯亮时间 30s。 constant dxnbyth:std_logic_vector(6 downto 4):=000。 constant dxnbytl:std_logic_vector(3 downto 0):=0100。 设置黄灯亮时间 4s。 constant dxnbrith:std_logic_vector(6 downto 4):=001。 constant dxnbritl:std_logic_vector(3 downto 0):=0101。 设置右转灯亮时间 15s。 constant dxnblth:std_logic_vector(6 downto 4):=010。 constant dxnbltl:std_logic_vector(3 downto 0):=0000。 设置左转灯亮时间 20s。 constant dxnbprth:std_logic_vector(8 downto 4):=10010。 constant dxnbprtl:std_logic_vector(3 downto 0):=0000。 设置人行道红灯亮时间120s。 constant dxnbpgth:std_logic_vector(8 downto 4):=00011。 constant dxnbpgtl:std_logic_vector(3 downto 0):=0100。 设置人行道绿灯亮时间34s。 constant dxnbrth:std_logic_vector(6 downto 4):=111。 constant dxnbrtl:std_logic_vector(3 downto 0):=0111。 设置红灯亮时间 77s。 begin process( ini,EN,CLK,tdxh,tdxl,tdxph,tdxpl,tnbh,tnbl,tnbph,tnbpl) begin tdx=tdxh amp。 tdxl。 tdxp=tdxph amp。 tdxpl。 tnb=tnbh amp。 tnbl。 tnbp=tnbph amp。 tnbpl。 if INI=39。 139。 THEN tdxh=000。 tdxl(3)=39。 039。 tdxl(2)=39。 039。 tdxl(1)=39。 039。 tdxl(0)=39。 139。 tdxph=00000。 tdxpl(3)=39。 039。 tdxpl(2)=39。 039。 tdxpl(1)=39。 039。 tdxpl(0)=39。 139。 tnbh=000。 tnbl(3)=39。 039。 tnbl(2)=39。 039。 tnbl(1)=39。 039。 tnbl(0)=39。 139。 tnbph=00000。 tnbpl(3)=39。 039。 tnbpl(2)=39。 039。 tnbpl(1)=39。 039。 tnbpl(0)=39。 139。 初始化,所有的倒计时显示 1s。 else if CLK39。 event and CLK=39。 139。 then if EN=39。 139。 then tdxh=tdxh。 tdxl=tdxl。 tdxph=tdxph。 tdxpl=tdxpl。 tnbh=tnbh。 tnbl=tnbl。 tnbph=tnbph。 tnbpl=tnbpl。 紧急情况,所有的倒计时保持原来的数不变。 light=10000101000010 else if ((tdx=1) or (tnb=1)) then s=s+1。 东西或南北方向有倒计时显示 1s,则跳到下个状态。 case s is when 0000=tdxh=dxnbgth。 tdxl=dxnbgtl。 东西方向倒计时时间等于绿灯亮的时间,东西方向绿灯亮。 tdxph=dxnbprth。 tdxpl=dxnbprtl。 东西方向人行道倒计时时间等于红灯亮的时间,人行道东西方向红灯亮。 tnbh=dxnbrth。 tnbl=dxnbrtl。 南北方向倒计时时间等于红灯亮的时间,南北方向红灯亮。 tnbph=dxnbpgth。 tnbpl=dxnbpgtl。 南北方向人行道倒计时时间等于绿灯亮的时间,人行道南北方向绿灯亮。 light=01000101000001。 东西方向绿灯亮,人行道红灯亮;南北方向红灯亮,人行道绿灯亮。 when 0001=tdxh=dxnbyth。 tdxl=dxnbytl。 东西方向倒计时时间等于黄灯亮的时间,东西方向黄灯亮。 tdxph=dxnbprth。 tdppl=dxnbprtl。 tnbh=dxn?rth。 tnbl=dxnbrtl。 tnbph=dxnbPgth。 tnbpl=dxnbpgtl。 light=00100101000001。 东 西斩向軄灯亮,人行道红灯亮;南北方向红灯亮,人行道绿灯亮。 when 0010=tdxh=dxnbrith。 tdxl=dxnbritl。 东西方向倒计时时间等于右转灯亮的时间,东西方向右转灯亮。 tdxph=dxnbprth。 tdxpl=dxnbprtl。 tnbh=dxnbrth。 tnbl=dxnbrtl。 tnbph=dxnbprth。 tnbpl=dxnbprtl。 南北方向人行道倒计时时间等于红灯亮的时间,人行道南北方向红灯亮。 light=00010101000010。 东西方向右转灯亮,人行道红灯亮;南北方向红灯亮,人行道红灯亮。 when 0011=tdxh=dxnbyth。 tdxl=dxnbytl。 东西方向倒计时时间等于黄灯亮的时间,东西方向黄灯亮。 tdxph=dxnbprth。 tdxpl=dxnbprtl。 tnbh=dxnbrth。 tnbl=dxnbrtl。 tnbph=dxnbprth。 tnbpl=dxnbprtl。 light=00100101000010。 东西方向黄灯亮,人行道红灯亮;南北方向红灯亮,人行道红灯亮。 when 0100=tdxh=dxnblth。 tdxl=dxnbltl。 东西方向倒计时时间等于左转灯亮的时间,东西方向左转灯亮。 tdxph=dxnbprth。 tdxpl=dxnbprtl。 tnbh=dxnbrth。 tnbl=dxnbrtl。 tnbph=dxnbprth。 tnbpl=dxnbprtl。 light=00001101000010。 东西方向左转灯亮,人行道红灯亮;南北方向红灯亮,人行道红灯亮。 when 0101=tdxh=dxnbyth。 tdxl=dxnbytl。 东西方向倒计时时间等于黄灯亮的时间,东西方向黄灯亮。 tdxph=dxnbprth。 tdxpl=dxnbprtl。 tnbh=dxnbrth。 tnbl=dxnbrtl。 tnbph=dxnbprth。 tnbpl=dxnbprtl。 light=00100101000010。 东西方向黄灯亮,人行道红灯亮;南北方向红灯亮,人行道红灯亮。 when 0110=tnbh=dxnbgth。 tnbl=dxnbgtl。 南北方向倒计时时间等于绿灯亮的时间,南北方向绿灯亮。 tnbph=dxnbprth。 tnbpl=dxnbprtl。 南北方向人行道倒计时时间等于红灯亮的时间,人行道南北方向红灯亮。 tdxh=dxnbrth。 tdxl=dxnbrtl。 东西方向倒计时时间等于红灯亮的时间,东西方向红灯亮。 tdxph=dxnbpgth。 tdxpl=dxnbpgtl。 东西方向人行道倒计时时间等于绿灯亮的时间,人行道东西方向绿灯亮。 light= 10000010100010。 东西方向红灯亮,人 行道绿灯亮;南北方向绿灯亮,人行道红灯亮。 when 0111=tnbh=dxnbyth。 tnbl=dxnbytl。 南北方向倒计时时间等于黄灯亮的时间,南北方向黄灯亮。 tnbph=dxnbprth。 tnbpl=dxnbprtl。 tdxh=dxnbrth。 tdxl=dxnbrtl。 tdxph=dxnbpgth。 tdxpl=dxnbpgtl。 light= 10000010010010。 东西方向红灯亮,人行道绿灯亮;南北方向黄灯亮,人行道红灯亮。 when 1000=tnbh=dxnbrith。 tnbl=dxnbritl。 南北方向倒计时时间等。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。