div8.vhd

来自「分别用分频比交错法及累加器分频法完成非整数分频器设计。」· VHDL 代码 · 共 27 行

VHD
27
字号
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity div8 is
port(clk2:in std_logic;      
         reset:in std_logic;
         C_ENB2:out std_logic;
         cout2:out std_logic);
end div8;

architecture behave of div8 is
signal cnt:std_logic_vector(2 downto 0);
begin
process(clk2,reset)
begin
if(reset='1')then
  cnt<="000";
  cout2<='0';
elsif(clk2'event and clk2='1')then
  cnt<=cnt+"001";
  cout2<=cnt(2);
  C_ENB2<=cnt(2)and cnt(1) and cnt(0);
end if;
end process;
end;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?