summaryrefslogtreecommitdiffstats
path: root/sw/cpld/address_decoder.vhd
blob: 2c80f861781763821e67803b236f438db5288fb2 (plain)
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
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity ADDRESS_DECODER is

port(
	-- address input
	PA: in unsigned(15 downto 0);

	-- chip selects output
	-- memory
	CSROMH: out std_logic;
	CSROML: out std_logic;
	CSRAM : out std_logic;
	-- io chips
	CSUART: out std_logic;
	CSCTC : out std_logic;
	CSPIO : out std_logic
);

end;

architecture Behavioral of ADDRESS_DECODER is
begin
	-- memory
	CSROMH <= 0 when ((PA >= x"0000") and (PA < x"2000"));
	CSROML <= 0 when ((PA >= x"4000") and (PA < x"4000"));
	CSRAM  <= 0 when (PA >= x"D000");
	-- io chips
	CSUART <= 0 when ((PA >= x"4000") and (PA < x"4008"));
	-- CSCTC
	-- CSPIO 

end Behavioral;