电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

计数器的VHDL设计

9页
  • 卖家[上传人]:re****.1
  • 文档编号:471979757
  • 上传时间:2023-01-12
  • 文档格式:DOC
  • 文档大小:135.51KB
  • / 9 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 1、实验名称: 计数器的VHDL设计 一、带高电平使能信号,低电平清零信号,低电平置数信号的十进制计数器的VHDL设计1.实体框图2.程序设计编译前的程序Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_unsigned.all;Entity cnt10 isPort(clk,RST,SET,EN:in std_logic;CQ:out std_logic_vector(3 downto 0);Cout:out std_logic);End cnt10;Architecture one of cnt10 isBeginProcess(clk,RST,SET,EN)Variable CQ1:std_logic_vector(3 downto 0);Begin if RST=0 Then CQ1:=(others=0); elsif clkevent and clk=1 then if SET=0 Then CQ1:=(others=1); elsif EN=1 Then if CQ10); end if; end if;

      2、end if;if CQ1=9 Then cout=1; else cout=0;end if;CQ0); elsif clkevent and clk=1 then if SET=0 Then CQ1:=(others=1); elsif EN=1 Then if CQ10); end if; end if; end if;if CQ1=9 Then cout=1; else cout=0;end if;CQ=CQ1;End process;End one;3.仿真波形图4.仿真波形分析当低电平清零信号有效时,计数器清零;当低电平置数信号有效时,计数器置数使能信号为高电平且脉冲上升沿有效时,计数器开始计数(从0到9)为十进制计数一、64进制的二进制计数器的VHDL设计1.实体框图2.程序设计编译前的程序Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_unsigned.all;Entity cnt64 isPort( clk:in std_logic; D:in std_logic_vector(5 downto

      3、0); Q:out std_logic_vector(5 downto 0);End cnt64;Architecture two of cnt64 is Signal Q1: std_logic_vector(5 downto 0);BeginProcess(clk) Begin if clkevent and clk=1 Then if(Q1=011111) Then Q1=000000; else Q1=Q1+1; end if; End process;Q=Q1;End two;程序编译错误情况Error (10500): VHDL syntax error at cnt64.vhd(18) near text process; expecting if;Error (10500): VHDL syntax error at cnt64.vhd(20) near text two; expecting if经过检查,发现原程序少了END IF,加上即可;正确的程序Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logi

      4、c_unsigned.all;Entity cnt64 isPort( clk:in std_logic; D:in std_logic_vector(5 downto 0); Q:out std_logic_vector(5 downto 0);End cnt64;Architecture two of cnt64 is Signal Q1: std_logic_vector(5 downto 0);BeginProcess(clk) Begin if clkevent and clk=1 Then if(Q1=011111) Then Q1=000000; else Q1=Q1+1; end if; end if; End process;Q=Q1;End two;3.仿真波形图4.仿真波形分析当脉冲信号为上升沿时,计数器开始计数(0到63),为64进制的二进制计数器一、64进制的高四位、低四位的BCD码设计1.实体框图2.程序设计编译前的程序Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_unsigned.a

      5、ll;Entity CDU_64 isPort( clk:in std_logic;Q:out std_logic_vector(7 downto 0);End CDU_64 ;Architecture three of CDU_64 is Signal cout2,cout1: std_logic_vector(3 downto 0);BeginProcess(clk) Begin if clkevent and clk=1 Then if(cout2=6 and cout1=3) Then cout2=0000; cout1=0000; else if (cout1=9)then cout2=cout2+1;cout1=0000; else cout2=cout2;cout1=cout1+1; end if; end if; end if; End process;Q=cout2 & cout1;End three;程序编译错误情况无正确的程序Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_unsigned.a

      6、ll;Entity CDU_64 isPort( clk:in std_logic;Q:out std_logic_vector(7 downto 0);End CDU_64 ;Architecture three of CDU_64 is Signal cout2,cout1: std_logic_vector(3 downto 0);BeginProcess(clk) Begin if clkevent and clk=1 Then if(cout2=6 and cout1=3) Then cout2=0000; cout1=0000; else if (cout1=9)then cout2=cout2+1;cout1=0000; else cout2=cout2;cout1=cout1+1; end if; end if; end if; End process;Q=cout2 & cout1;End three;3.仿真波形图4.仿真波形分析64进制的BCD码设计:分为高四位和低四位,当低四位从0到9时,高四位进1,直到低四位从0到9,使得高四位从0到6,最后一次低四位计数到3为止,实现64进制的BCD码计数功能一、8位左移计数器的VHDL设计1.实体框图2.程序设计编译前的程序Library ieee;Use ieee.std_logic_1164.all;Entity shfrt isPort( clk,load:in std_logic; DIN:in std_logic_vector(7 downto 0); QB:out std_logic);End shfrt;Architecture four of shfrt is Beginprocess(clk,Load)variable REG8:std_logic_vector(7 downto 0); Begin if clkevent and clk=1 Then if load=1 Then REG8:=DIN; else REG8(7 downto 1):=REG8(6 downto 0) REG8(0):=1

      《计数器的VHDL设计》由会员re****.1分享,可在线阅读,更多相关《计数器的VHDL设计》请在金锄头文库上搜索。

      点击阅读更多内容
    最新标签
    监控施工 信息化课堂中的合作学习结业作业七年级语文 发车时刻表 长途客运 入党志愿书填写模板精品 庆祝建党101周年多体裁诗歌朗诵素材汇编10篇唯一微庆祝 智能家居系统本科论文 心得感悟 雁楠中学 20230513224122 2022 公安主题党日 部编版四年级第三单元综合性学习课件 机关事务中心2022年全面依法治区工作总结及来年工作安排 入党积极分子自我推荐 世界水日ppt 关于构建更高水平的全民健身公共服务体系的意见 空气单元分析 哈里德课件 2022年乡村振兴驻村工作计划 空气教材分析 五年级下册科学教材分析 退役军人事务局季度工作总结 集装箱房合同 2021年财务报表 2022年继续教育公需课 2022年公需课 2022年日历每月一张 名词性从句在写作中的应用 局域网技术与局域网组建 施工网格 薪资体系 运维实施方案 硫酸安全技术 柔韧训练 既有居住建筑节能改造技术规程 建筑工地疫情防控 大型工程技术风险 磷酸二氢钾 2022年小学三年级语文下册教学总结例文 少儿美术-小花 2022年环保倡议书模板六篇 2022年监理辞职报告精选 2022年畅想未来记叙文精品 企业信息化建设与管理课程实验指导书范本 草房子读后感-第1篇 小数乘整数教学PPT课件人教版五年级数学上册 2022年教师个人工作计划范本-工作计划 国学小名士经典诵读电视大赛观后感诵读经典传承美德 医疗质量管理制度 2
    关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
    手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
    ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.