xspled.vhd

来自「用VHDL语言编写的代码」· VHDL 代码 · 共 54 行

VHD
54
字号
--------------------------------------------------------------------------------
-- Copyright (c) 2000 by Trenz Electronic.
-- Duenner Kirchweg 77, 32257 Buende, Germany, www.trenz-electronic.de
--     
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--     
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--     
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
--------------------------------------------------------------------------------
-- Project:      Full-Speed USB 1.1 Function Controller
-- File:         xspLED.vhd
-- Description:  XSP-010 board, 7-Segment LED register.
-- Version:      FB, 2000jun05
--------------------------------------------------------------------------------

library IEEE;
use IEEE.STD_LOGIC_1164.all;

entity xspLED is
	port(
		A :   in  STD_LOGIC_VECTOR(15 downto 0); -- address bus
		WR :  in  STD_LOGIC;                     -- write enable
		DWR : in  STD_LOGIC_VECTOR(7 downto 0);  -- data bus
		LED : out STD_LOGIC_VECTOR(6 downto 0)   -- LED segments
		);
end xspLED;

--------------------------------------------------------------------------------
architecture BHV of xspLED 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;

--------------------------------------------------------------------------------
-- end of file

⌨️ 快捷键说明

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