-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreg.vhd
More file actions
30 lines (27 loc) · 694 Bytes
/
Copy pathreg.vhd
File metadata and controls
30 lines (27 loc) · 694 Bytes
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
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity reg is
port(
clk: in std_logic;
rst: in std_logic;
wr_en: in std_logic;
data_in: in unsigned(15 downto 0);
data_out: out unsigned(15 downto 0)
);
end entity;
architecture a_reg of reg is
signal registry: unsigned(15 downto 0);
begin
process(clk,rst,wr_en)
begin
if rst='1' then
registry <= "0000000000000000";
elsif wr_en='1' then
if rising_edge(clk) then
registry <= data_in;
end if;
end if;
end process;
data_out <= registry;
end architecture a_reg;