Question: Need help creating the memory for my CPU code: Problem Overview : The project will simulate a simple computer system consisting of a CPU and

Need help creating the memory for my CPU code: Problem Overview: The project will simulate a simple computer system consisting of a CPU and Memory. The CPU and Memory will be simulated by separate processes that communicate. Memory will contain one program that the CPU will execute and then the simulation will end.

Problem Details

CPU

It will have these registers: PC, SP, IR, AC, X, Y. It will support the instructions shown on the next page of this document. It will run the user program at address 0. Instructions are fetched into the IR from memory. The operand can be fetched into a local variable. Each instruction should be executed before the next instruction is fetched. The user stack resides at the end of user memory and grows down toward address 0. The system stack resides at the end of system memory and grows down toward address 0. There is no hardware enforcement of stack size. The program ends when the End instruction is executed. The 2 processes should end at that time. The user program cannot access system memory (exits with error message).

Memory: It will consist of 2000 integer entries, 0-999 for the user program, 1000-1999 for system code. It will support two operations:

read(address) - returns the value at the address

write(address, data) - writes the data to the address

Memory will read an input file containing a program into its array, before any CPU fetching begins. Note that the memory is simply storage; it has no real logic beyond reading and writing.

My CPU code: Need help creating the memory for my CPU code: Problem Overview: The

project will simulate a simple computer system consisting of a CPU and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!