Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Simulate the following program by converting each instruction to corresponding machine code. Then store the machine code in memory starting from location 1 0 :
Simulate the following program by converting each instruction to corresponding machine code. Then store the
machine code in memory starting from location : module SIMCOMP clock PC IR MBR AC MAR;
input clock;
output PC IR MBR AC MAR;
reg : IR MBR AC;
reg : PC MAR;
reg : Memory :;
reg : state;
parameter load b storeb addb;
initial begin
program
Memory h;
Memory h;
Memory hB;
data at byte addres
Memory d;
Memory d;
set the program counter to the start of
PC ; state ;
end
always @posedge clock begin
case state
: begin
MAR PC;
state;
end
: begin fetch the instruction from mem
IR MemoryMAR;
PC PC ;
state; next state
end
: begin Instruction decode
MAR IR:;
state;
end
: begin Operand fetch
state;
case IR:
load : MBR MemoryMAR ;
add : MBR MemoryMAR ;
store: MBRAC;
endcase
end
: begin execute
if IR:h begin
AC ACMBR;
state ;
end
else if IR :h begin
AC MBR;
state ; next state
end
else if IR:hB begin
Memory MAR MBR;
state ;
end
end
endcase
end
endmodule
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started