source1.vhd

来自「大屏幕led点阵显示的驱动时序。 使用vhdl语言描述。其中rom文件可以使用l」· VHDL 代码 · 共 28 行

VHD
28
字号
--Source1 地址寻址信号
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity source1 is
port(clk:in std_logic;
     outer:out std_logic_vector(7 downto 0));
end source1;
architecture  behave of source1 is
signal temp1:std_logic_vector(3 downto 0);--temp1为地址低4位 代表一帧数据
signal temp2:std_logic_vector(3 downto 0);--temp1为地址高4位 代表帧数
signal time:integer range 0 to 15;--time为帧循环次数计数 每帧扫16遍
begin 
  process(clk)
  begin  
       if(clk'event and clk='1')then 
           if temp1="1111" then
               if time<15  then time<=time+1;
               else time<=0;temp2<=temp2+'1';
               end if;
           end if;
           temp1<=temp1+'1'; --转为下帧数据          
       end if;      
  end  process;  
outer<=temp2 & temp1;  
end behave;

⌨️ 快捷键说明

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