基于fpga的电机测速显示设计内容摘要:

d_logic。 endmeasure,gate:out std_logic)。 end control。 architecture art of control is signal q:integer range 0 to 1。 begin process(clk,reset,start) begin if reset=39。 139。 then gate=39。 039。 不允许计数 endmeasure=39。 039。 计数器复位 elsif start=39。 139。 then if clk39。 event and clk=39。 139。 then if q=1 then gate=39。 039。 达到一分钟不允许再计数 q=0。 endmeasure=39。 139。 计数器复位 else gate=39。 139。 q=q+1。 endmeasure=39。 039。 计数器不复位 end if。 end if。 end if。 end process。 end architecture。 ,其中 clr与 endmeasure相连 ena与 gate相连,第一个 SM传感器信号与产生的 CP脉冲信号相连, 第一、二、三 carryout与 sm相 连,第四carryout置空,显示信号 xs分别与下一单元寄存器 D相连 ,clr为零, ena为 1, sm接到上升沿脉冲时计数 十进制计时器 library ieee。 已调试 use。 use。 use。 entity t10 is port(clr,ena,sm:in std_logic。 carryout:out std_logic。 xs:out std_logic_vector(0 to 3) )。 end t10。 architecture art of t10 is signal temp:std_logic_vector(0 to 3)。 begin c1:process(clr,sm,ena) begin if clr=39。 139。 then temp=0000。 计数器清零 elsif ena=39。 139。 then 计数使能 if sm=39。 139。 then开始计数 if temp=1001then temp=0000。 达到 9清零 else temp=temp+1。 end if。 end if。 end if。 end process c1。 c2:process(temp)temp做为触发信号 begin if temp=0000then carryout=39。 139。 向高位进位 end if。 end process c2。 xs=temp。 end art。 ,当 60s时间到时 ,四位寄存器 ena使能,将寄存器中的数据输出 ,其中 ena与endmeasure相连, 作用为将数据存储。 四位寄存器 生成的器件如图所示 library ieee。 已调试 use。 use。 use。 entity shortage4 is port(ena:in std_logic。 接 endmeasure,当为 1时允许输出 D:in std_logic_vector(0 to 7)。 Q:out std_logic_vector(0 to 7) )。 end entity shortage4。 architecture art of shortage4 is signal temp: std_logic_vector(0 to 7)。 begin process(ena) begin if ena=39。 139。 then temp=D。 end if。 end process。 Q=temp。 end architecture art。 LED与寄存器相连,运用动态扫描,从高位依次向低位闪烁。 用四个数码管,显示范围为 0000到9999。 与寄存器 Q端口相连,做为段选信号, 但 LED灯亮否还得看位选信号。 7段 共阴极 LED译码器 所生成的器件如图示 单输入单输出,每次选定一个数,对应一七位数据,然后将七位数据送出。 library ieee。 已调试 use。 use。 use。 entity ymq is port( ain4:in std_logic_vector(0 to 3)。 bout7:out std_logic_vector(0 to 6) )。 end ymq。 architecture cymq of ymq is signal temp:。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。