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

📄 process_avg.vhd

📁 led display programme
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
library lpm;
use lpm.lpm_components.all;

entity process_avg is
	port(clk     : in std_logic;
		 dff_clk :in std_logic;
		 dff_clr : in std_logic;--high level reset
		 datain  : in std_logic_vector(31 downto 0);
		 result  : out std_logic_vector(31 downto 0)
			);
end process_avg;

architecture behave of process_avg is

component float_add port(clk:in std_logic;
						 f_a:in std_logic_vector(31 downto 0);
						 f_b:in std_logic_vector(31 downto 0);
						 f_out:out std_logic_vector(31 downto 0)
							);
end component;

signal ff_result:std_logic_vector(31 downto 0):=(others => '0');
signal tmp_result:std_logic_vector(31 downto 0):=(others => '0');
begin
	ADD:float_add port map(clk => clk,
						   f_a => datain,
						   f_b => ff_result,
						   f_out => tmp_result
							);
							
	REG:lpm_ff generic map(LPM_WIDTH => 32)
			   port map(data => tmp_result,
						clock => dff_clk,
						aclr => dff_clr,
						Q => ff_result
						);
						
	result <= tmp_result;
						
end behave;

	

⌨️ 快捷键说明

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