• 利用Quartus设计4位同步二进制加法计数器


    一、设计原理

          4位同步二进制加法计数器的工作原理是指当时钟信号clk的上升沿到来时,且复位信号clr低电平有效时,就把计数器的状态清0。

          在clr复位信号无效(即此时高电平有效)的前提下,当clk的上升沿到来时,如果计数器原态是15,计数器回到0态,否则计数器的状态将加1

     二、VHDL源程序

    library ieee;
    use ieee.std_logic_1164.all;
    entity cnt4e is
       port(clk,clr:in std_logic;
    
             cout:out std_logic;
    		 q:buffer integer range 0 to 15);
    	end cnt4e;
    architecture one of cnt4e is
    begin
    	process(clk,clr)
    	begin
    		if clk'event and clk='1'then
    			if clr='1'then
    				if q=15 then q<=0;
    					cout<='0';
    				elsif q=14 then q<=q+1;
    					cout<='1';
    					else q<=q+1;
    					end if;
    			else q<=0;
    				cout<='0';
    			end if;
    		end if;
    	end process;
    end one;
    

    三、仿真波形图

     

    VerilogHDL和一个的编程语言其实也差不多,关键在于首先要了解所搭的电路。不仅仅是纯语言思想,同时动手实践也相当重要。

     

  • 文章声明
  • 作者:Owen
  • 出处: http://www.cnblogs.com/owenyang
  • 本文版权归作者,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。该博客同步发在 HEXO-博客
  • 相关阅读:
    RabbitMQ + PHP (二)AMQP拓展安装
    RabbitMQ + PHP (一)入门与安装
    使用 Selenium 实现基于 Web 的自动化测试
    Selenium私房菜系列4 -- Selenium IDE的使用
    解决火狐浏览器安装不上Selenium IDE插件“此附加组件无法安装”
    (技术分享) 解决 Firefox 显示“已阻止载入混合活动内容”的问题
    MyEclipse打开 HTML 报错Failed to create the part's controls
    python2x与python3x的区别
    Python基础总结
    Mycat 读写分离+分库分表
  • 原文地址:https://www.cnblogs.com/owenyang/p/3579087.html
  • Copyright © 2020-2023  润新知