-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreg_14.vhd
More file actions
30 lines (27 loc) · 704 Bytes
/
reg_14.vhd
File metadata and controls
30 lines (27 loc) · 704 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_14 is
port(
clk: in std_logic;
rst: in std_logic;
wr_en: in std_logic;
data_in: in unsigned(13 downto 0);
data_out: out unsigned(13 downto 0)
);
end entity;
architecture a_reg_14 of reg_14 is
signal registry: unsigned(13 downto 0);
begin
process(clk,rst,wr_en)
begin
if rst='1' then
registry <= "00000000000000";
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_14;