work_register.vhd

来自「一个8位微处理器的VHDL代码以及testbench」· VHDL 代码 · 共 27 行

VHD
27
字号
library ieee;use ieee.std_logic_1164.all; -- each module will need to use std_logicentity work_register is	port(   reset : in std_logic; -- master reset, same for each sequential module	        clk :	in std_logic; -- same clock drives each sequential module	        we:               in std_logic; -- controller sets this signal when WR_out need to be fetched		        WR_Code_in:          in std_logic_vector(7 downto 0);	        WR_out:	     out std_logic_vector(7 downto 0) ); end entity work_register;architecture work_register of work_register issignal WR_internal: std_logic_vector(7 downto 0);begin	process(clk) is	begin		if rising_edge(clk) then			if (reset = '1') then WR_internal <= (others => '0');			elsif (we = '1') then WR_internal <= WR_Code_in;			end if;		end if; -- rising_edge(clk)		end process; 	WR_out <= WR_internal;end;

⌨️ 快捷键说明

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