This java program simulates the operation of a CPU and memory including the ALU, accumulator, registers, and program counter. The program takes in an 8 bit binary number including the op code and the value. Instructions include load/store instructions, add/sub accumulator and immediate, add/sub accumulator and value in memory address, halt and a jump instruction. The output displays the PC, the value in the accumulator, and the instruction being executed.
Source Code
CPU.jar
Execute .jar in cmd or terminal with:
java -jar CPU.jar
No comments:
Post a Comment