這邊是Core code的宣告區
ENTITY CPU IS
PORT( clock, reset : IN STD_LOGIC;
program_counter_out : OUT STD_LOGIC_VECTOR( 7 DOWNTO 0 );
register_AC_out : OUT STD_LOGIC_VECTOR(15 DOWNTO 0 );
memory_data_register_out : OUT STD_LOGIC_VECTOR(15 DOWNTO 0 ));
END CPU;
ARCHITECTURE a OF CPU IS
TYPE STATE_TYPE IS ( reset_pc, fetch, decode, execute_add, execute_load, execute_store,
execute_store3, execute_store2, execute_jump );
SIGNAL state: STATE_TYPE;
SIGNAL instruction_register, memory_data_register : STD_LOGIC_VECTOR(15 DOWNTO 0 );
SIGNAL register_AC : STD_LOGIC_VECTOR(15 DOWNTO 0 );
SIGNAL program_counter : STD_LOGIC_VECTOR( 7 DOWNTO 0 );
SIGNAL memory_address_register : STD_LOGIC_VECTOR( 7 DOWNTO 0 );
SIGNAL memory_write : STD_LOGIC;
BEGIN 作者: syuan08 時間: 2016-1-8 16:54:40