Question: module Simplecomp ( input wire clk , input wire reset, input wire [ 1 5 : 0 ] data _ in , output wire [
module Simplecomp
input wire clk
input wire reset,
input wire : datain
output wire : dataout,
output wire : addrout
;
Memory Address Register
reg : MAR;
Memory Buffer Register
reg : MBR;
Program Counter
reg : PC;
Instruction Register
reg : IR;
General Purpose Registers
reg : R:;
always @posedge clk or posedge reset begin
if reset begin
PC b;
MAR b;
MBR b;
IR b;
for integer i ; i ; i i begin
Rib;
end
end else begin
Fetch instruction
MAR PC;
IR MBR;
PC PC ;
Decode and execute instruction
case IR:
b: LOAD
if IR:b begin Direct memory address
MAR IR:;
RIR: MBR;
end else if IR:b begin Register
RIR: RIR:;
end else if IR:b begin Register Indirect
MAR RIR:;
RIR: MBR;
end else if IR:b begin Constant
RIR: IR:;
end
b: STORE
MAR IR:;
MBR RIR:;
b: ADD
RIR: RIR: RIR:;
b: SUB
RIR: RIR: RIR:;
b: MUL
RIR: RIR: RIR:;
b: DIV
RIR: RIR: RIR:;
endcase
end
end
assign dataout MBR;
assign addrout MAR;
endmodule
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
