Chapter 5
テキストは下のようにメモリーマップしている。
- 0~16383番地: RAM
- 16384~24575番地: Screen
- 24576番地: Keyboard
ここではひとまず下のように割り当てておく。
- 0~63番地: RAM + Screen
- 64番地: Keyboard
library ieee; use ieee.std_logic_1164.all; entity memory is port ( inp: in std_logic_vector(15 downto 0); clk: in std_logic; address: in std_logic_vector(14 downto 0); load: in std_logic; dip_sw: in std_logic_vector(15 downto 0); outp: out std_logic_vector(15 downto 0) ); end entity; architecture behavior of memory is signal outp_ram64, outp_keyboard: std_logic_vector(15 downto 0); begin ram: entity work.ram64 port map ( inp => inp, clk => clk, load => load, address => address(5 downto 0), outp => outp_ram64 ); keyboard: entity work.register_16_bit port map ( clk => clk, load => '1', d => dip_sw, q => outp_keyboard ); mux: entity work.mux16 port map ( a => outp_ram64, b => outp_keyboard, sel => address(6), outp => outp ); end architecture;