基于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。 南北方向倒计时时间等。基于vhdl的交通灯控制系统设计--毕业论文
相关推荐
124=d=254。 when 125=d=254。 when 126=d=255。 when 127=d=255。 when others=null。 end case。 end if。 其中,时钟信号 clk,复位信号 clr, 8位二进制输出信号端口 d。 程序设计流程图如下图所示: 输 出 赋 值 0NYNY计 数 器 是否 为 1 2 7。 复 位 信 号是 否 为 0。 查 表 输
then coin=0011。 next_state=state3。 elsif datain=10 then coin=0100。 next_state=state4。 elsif datain=00 then act10=39。 139。 act5=39。 039。 coin=0000。 next_state=idle。 end if。 when state3= if datain=01
//用 read()函数读取实际按键值放入缓存中 if (read(buttons_fd, current_buttons, sizeof current_buttons) != sizeof current_buttons) { . . perror(read buttons:)。 //读取失败则显示错误信息 exit(1)。 } //循环比较数组 buttons[i]和
T_R2。 reg clk2。 reg [7:0] passed。 reg [7:0] alarmed。 /*输入与输出的声明部分,其中, clk0 为输入的时钟信号, resetb 为密码舒服的输入信号,key 为输入命令, 需注意的时, key 并不是总在表示密码,也表示密码的间隔,如当输入 4 位密码后需要一个确认“ enter”信号, 当密码输入错误时,需要取消“ cancel”信号
Click() If = True Then = False End If = 9600,N,8,1 = 1 = True = 0 End Sub Private Sub Command2_Click() Call CommPortClose intCommFlag = 0 End Sub Call FileSendManager(0) intCommFlag = 1 End If
算接触强度时运转初期(未经跑合)的齿向载荷分布系数,由齿向载荷分布图可查得。 参照濮良贵《机械设计》表 104 HWK —— 计算接触强度时跑合影响系数 ; 0FK —— 计算弯曲强度时运转初期(未经跑合)的齿向载荷分布系数,由齿向载荷分布图可查得 ; KFW—— 计算弯曲强度时的跑合影响系数; KHe—— 与均载系数有关的系数; KFe—— 与均载荷系数有关的系数。 则可得 KHβ 、