OSDN Git Service

added root Makefile.
[motonesfpga/motonesfpga.git] / simulation / cpu / cpu_reg.vhd
1 library ieee;
2 use ieee.std_logic_1164.all;
3
4 entity cpu_reg is 
5     generic (dsize : integer := 8);
6     port (  clk, en     : in std_logic;
7             d           : in std_logic_vector (dsize - 1 downto 0);
8             q           : out std_logic_vector (dsize - 1 downto 0)
9         );
10 end cpu_reg;
11
12 architecture rtl of cpu_reg is
13 begin
14     p : process (clk)
15     begin
16     if (clk'event and clk = '1') then
17         if (en = '1') then
18             q <= d;
19         end if;
20     end if;
21     end process;
22 end rtl;
23