交通灯各模块设计..docVIP

  • 10
  • 0
  • 约8.42千字
  • 约 9页
  • 2016-12-25 发布于重庆
  • 举报
交通灯模块设计 1.分频器模块设计与仿真 该模块可将频率为1KHZ的脉冲波,经过分频变为频率为1HZ的脉冲波,这样我们就得到了周期为1S的脉冲波。 分频器程序清单如下: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity fenpinqi is port ( clk1khz:in std_logic; clk1hz:out std_logic); end fenpinqi; architecture a of fenpinqi is begin process( clk1khz ) variable q: integer:=0 ; variable r:std_logic:=0; begin if clk1khzevent and clk1khz=1 then if q=512 then r:=not r; q:=0; else q:=q+1; end if; clk1hz=r; end if; end process; end a; 分频器程序仿真结果如图1-1所示: 图1-1 分频器程序仿真结果图 在分频器程序仿真

文档评论(0)

1亿VIP精品文档

相关文档