on Quartus software =============================== module SIMCOMP (clock, PC, IR, MBR, AC, MAR); input clock; output PC, IR, MBR, AC, MAR; reg [15:0] IR, MBR, AC; reg [11:0] PC, MAR; reg [15:0] Memory [0:63]; reg [2:0] state; parameter load = 4'b0011, store = 4'b1011, add=4'b0111; initial begin // program Memory [10] = 16'h3020; Memory [11] = 16'h7021; Memory [12] = 16'HB014;

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Question on Quartus software
===============================

module SIMCOMP (clock, PC, IR, MBR, AC, MAR);
input clock;
output PC, IR, MBR, AC, MAR;
reg [15:0] IR, MBR, AC;
reg [11:0] PC, MAR;
reg [15:0] Memory [0:63];
reg [2:0] state;

parameter load = 4'b0011, store = 4'b1011, add=4'b0111;

initial begin
// program
Memory [10] = 16'h3020;
Memory [11] = 16'h7021;
Memory [12] = 16'HB014;

// data at byte addres
Memory [32] = 16'd7;
Memory [33] = 16'd5;

//set the program counter to the start of the program
PC = 10; state = 0;
end


always @ (posedge clock) begin
case (state)
0: begin
MAR <= PC;
state=1;
end
1: begin // fetch the instruction from
IR <= Memory[MAR];
PC <= PC + 1;
state=2; //next state
end
2: begin //Instruction decode
MAR <= IR[11:0];
state= 3;
end
3: begin // Operand fetch
state =4;
case (IR[15:12])
load : MBR <= Memory[MAR];
add : MBR <= Memory[MAR];
store: MBR<=AC;
endcase
end

4: begin //execute
if (IR[15: 12]==4'h7) begin
AC<= AC+MBR;
state =0;
end
else if (IR[15:12] == 4'h3) begin
AC <= MBR;
state =0; // next state
end
else if (IR[15:12] == 4'hB) begin
Memory[ MAR] <= MBR;
state = 0;
end
end
endcase
end
endmodule

========================

Thank's

Abdulrahim Tayisr

SIMCOMP2; Add register file
Modify the instruction format so that SIMCOMP2 can handle four addressing modes and four
registers.To this end, SIMCOMP is an accumulator machine which you can thinkof as a
machine with one general-purpose register. Historically, many old computers were
accumulatormachines.
This new SIMCOMP2 has four 16-bit general purpose registers, R[0], R[1], R[2] and R[3]
which replace the AC. In Verilog, you declare R as a bank of registers much like we do
Memory:
reg [15:0] R[0:3];
And, since registers are usually on the CPU chip, we have no modeling limitations as we do
with Memory - with Memory we have to use the MAR and MBR registers to access MEM.
Therefore, in a load you could use R as follows:
R[IR[9:8]] <- MBR;where the 2 bits in the IR specify which R register to set.
Transcribed Image Text:SIMCOMP2; Add register file Modify the instruction format so that SIMCOMP2 can handle four addressing modes and four registers.To this end, SIMCOMP is an accumulator machine which you can thinkof as a machine with one general-purpose register. Historically, many old computers were accumulatormachines. This new SIMCOMP2 has four 16-bit general purpose registers, R[0], R[1], R[2] and R[3] which replace the AC. In Verilog, you declare R as a bank of registers much like we do Memory: reg [15:0] R[0:3]; And, since registers are usually on the CPU chip, we have no modeling limitations as we do with Memory - with Memory we have to use the MAR and MBR registers to access MEM. Therefore, in a load you could use R as follows: R[IR[9:8]] <- MBR;where the 2 bits in the IR specify which R register to set.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY