led.vhd

来自「USB与FPGA接口的程序设计。里面是所有的源文件都经本人测试可以用」· VHDL 代码 · 共 22 行

VHD
22
字号
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity LED is
	port(
		A :   in  STD_LOGIC_VECTOR(15 downto 0); -- 地址总线
		WR :  in  STD_LOGIC;                     -- 写使能
		DWR : in  STD_LOGIC_VECTOR(7 downto 0);  -- 数据总线
		LED : out STD_LOGIC_VECTOR(6 downto 0)   -- LED段码
		);
end xspLED;
architecture BHV of LED is
begin	
	process(A, DWR, WR)
	begin
		if A(15 downto 12)= "1111" then
			if rising_edge(WR) then
				LED<= DWR(6 downto 0);
			end if;
		end if;
	end process;
end BHV;

⌨️ 快捷键说明

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