⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gaiiao1.vhd

📁 这是正玹实现代码,通过LUT来实现的!!!比其他要简单的多!还有方波,三角波的不同的VHDL程序实现.
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity gaiiao1 is
  port(clk,reset:in std_logic;
       q:out std_logic_vector(3 downto 0));
end gaiiao1;
architecture gaiiao1_arc of gaiiao1 is
begin 
  process(clk,reset)
  variable tmp:std_logic_vector(3 downto 0);
  variable a:std_logic;
begin
  if reset='1' then
     tmp:="0000";
  elsif clk'event and clk='1' then
     if a='0' then
       tmp:=tmp+1;
          if tmp="1111" then
          a:='1';
          end if;
     end if;    
     if a='1' then
       tmp:=tmp-1;
         if tmp="0000" then
         a:='0';
         end if;
     end if;
  end if;
q<=tmp;
end process;
end gaiiao1_arc;

⌨️ 快捷键说明

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