summaryrefslogtreecommitdiff
path: root/2004/n/fpga/src/interrupt/reg_8.vhd
diff options
context:
space:
mode:
Diffstat (limited to '2004/n/fpga/src/interrupt/reg_8.vhd')
-rw-r--r--2004/n/fpga/src/interrupt/reg_8.vhd33
1 files changed, 33 insertions, 0 deletions
diff --git a/2004/n/fpga/src/interrupt/reg_8.vhd b/2004/n/fpga/src/interrupt/reg_8.vhd
new file mode 100644
index 0000000..f32f7d9
--- /dev/null
+++ b/2004/n/fpga/src/interrupt/reg_8.vhd
@@ -0,0 +1,33 @@
+-- reg_8.vhd
+-- Eurobot 2004 : APB Team
+-- Auteur : Pierre-André Galmes
+-- Registre 8 bits.
+
+
+library IEEE;
+use IEEE.STD_LOGIC_1164.all;
+
+
+entity reg_8 is
+ port (
+ rst : in std_logic;
+ clk : in std_logic;
+ en : in std_logic; -- enable
+ input : in std_logic_vector (7 downto 0);
+ output : out std_logic_vector (7 downto 0)
+ );
+end reg_8;
+
+architecture RTL of reg_8 is
+begin
+ process (rst, clk)
+ begin
+ if (rst ='1') then
+ output <= x"00";
+ elsif (clk'event and clk = '1') then
+ if (en='1') then
+ output <= input;
+ end if;
+ end if;
+ end process;
+end RTL;