-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregDATA.vhd
34 lines (32 loc) · 1010 Bytes
/
regDATA.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-------------------------------------------------------------------------------
-- Title : Registrador de entrada/saida
-- Project :
-------------------------------------------------------------------------------
-- File : regDATA.vhd
-- Author : Geraldo Travassos
-- Standard : VHDL'87
-------------------------------------------------------------------------------
-- Description: Registrador de entrada/saida
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity regDATA is
generic(n :natural:=16);
port( clk,rst,en :in std_logic;
reg_in :in unsigned(n-1 downto 0);
reg_out :out unsigned(n-1 downto 0));
end regDATA;
architecture anem16 of regDATA is
begin
registrador: process (clk,rst)
begin
if rst = '0' then
reg_out <= (others => '0');
elsif en = '1' and rising_edge(clk) then
reg_out <= reg_in;
else
null;
end if;
end process registrador;
end anem16;