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