4 LSB +<--------> PC | | 4 LSB | MAR <-------------+<--------> A | | | | 4 LSB | | | | | v | v RAM <------------>|<-------- ALU | ^ | | | | | | <-------------+ | IR ------------->|<--------> B | 4 LSB | | | | | | 4 MSB +---------> OUT | | v | ins v decoder DISPLAY --- instruction set LDA 0b_0000_ Load memory > A ADD 0b_0001_ "Add memory" + A -> A OUT ____________ 0b_1110_xxxx Output A -> OUT HLT ____________ 0b_1111_xxxx Sets halt flag --- operation 1. Load instruction @ PC into INS, Increment PC. a) PC out -> MAR (PC_to_bus) + (bus_to_MAR) + (clk) b) MEM -> INS, PC++ (RAM_to_bus) + (bus_to_INS) + (PC_count_en) + (clk) 2. Decode and execute instruction. 2.I LDA: Load memory into A a) INS_lsb -> MAR (INS_to_bus) + (bus_to_MAR) + (clk) b) MEM -> A (RAM_to_bus) + (bus_to_A) + (clk) 2.II ADD: Load mem in B, ALU "auto" adds, put back in A a) INS_lsb -> MAR (INS_to_bus) + (bus_to_MAR) + (clk) b) MEM -> B (RAM_to_bus) + (bus_to_B) + (clk) c) ALU -> A (ALU_to_bus) + (bus_to_A) + (clk) 2.III OUT: Put A in OUT a) A -> OUT (A_to_bus) + (bus_to_OUT) + (clk)