-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPC.vhd
More file actions
51 lines (40 loc) · 1.07 KB
/
PC.vhd
File metadata and controls
51 lines (40 loc) · 1.07 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
----------------------------------------------------------------------------------
-- Company: NUS
-- Engineer: Rajesh Panicker
--
-- Create Date: 21:06:18 14/10/2014
-- Design Name: PC
-- Target Devices: Nexys 4 (Artix 7 100T)
-- Tool versions: ISE 14.7
-- Description: PC for the basic MIPS processor
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments: The interface (entity) as well as implementation (architecture) can be modified
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity PC is
Port( PC_in : in STD_LOGIC_VECTOR (31 downto 0);
PC_out : out STD_LOGIC_VECTOR (31 downto 0) := x"00400000";
RESET : in STD_LOGIC;
CLK : in STD_LOGIC);
end PC;
architecture arch_PC of PC is
begin
process (CLK)
begin
--<implement PC here>
if (CLK'event and CLK = '1') then
if RESET = '1' or PC_in = x"004003FC" then
PC_out <= x"00400000";
else
PC_out <= PC_in;
end if;
end if;
end process;
end arch_PC;