一、设计原理

      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;

三、仿真波形图

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

 

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

 

相关文章:

  • 2021-06-15
  • 2022-12-23
  • 2021-11-06
  • 2021-05-17
  • 2021-11-20
  • 2021-08-15
  • 2021-06-12
  • 2021-04-18
猜你喜欢
  • 2021-10-05
  • 2021-12-05
  • 2022-12-23
  • 2021-10-17
  • 2021-10-23
  • 2021-06-03
  • 2021-06-17
相关资源
相似解决方案