-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMemoryAddressDecoder.vhd
More file actions
34 lines (30 loc) · 949 Bytes
/
Copy pathMemoryAddressDecoder.vhd
File metadata and controls
34 lines (30 loc) · 949 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
31
32
33
34
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
USE std.textio.ALL;
USE ieee.std_logic_textio.ALL;
USE IEEE.math_real.ALL;
ENTITY MemoryAddressDecoder IS
PORT (
ALU_Res : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
Prev_SP : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
Push : IN STD_LOGIC;
WB_INT : IN STD_LOGIC;
RST : IN STD_LOGIC;
Address_out : OUT STD_LOGIC_VECTOR(11 DOWNTO 0));
END MemoryAddressDecoder;
ARCHITECTURE MemoryAddressDecoderArch OF MemoryAddressDecoder IS
BEGIN
PROCESS (ALU_Res, Prev_SP, Push, WB_INT, RST)
BEGIN
IF (RST = '1') THEN
Address_out <= (OTHERS => ('0'));
ELSIF WB_INT = '1' THEN
Address_out <= "000000000010";
ELSIF Push = '1' THEN
Address_out <= Prev_SP(11 DOWNTO 0);
ELSE
Address_out <= ALU_Res(11 DOWNTO 0);
END IF;
END PROCESS;
END MemoryAddressDecoderArch;