
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
//
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.](https://content.bartleby.com/qna-images/question/4df8bf1c-3b80-4152-984a-689b7a4b1775/5e5be30a-482f-4e65-9396-26e6a293f20b/pfzwba_thumbnail.png)

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

- Assembly language ARM-Cortex I am using a Tiva Board With Port F open with PF1 output, and PF0,PF4 inputs some of my code for reference LDR R0, =SYSCTL_RCGCGPIO_R ; 1) clock for port FLDR R1, [R0] ;get all bitsORR R1, R1, #0x20 ; bit 5, turn on clockSTR R1, [R0] ;update ports i have more code thats only for reference i just need help with that is displayed in the imagearrow_forwardWrite the following code segment in MARIE assembly language. (Hint: Turn the for loop into a while loop):Sum = 0;for X = 1 to 10 doSum = Sum + X;arrow_forwardDescribe the advantages of using a pipelined architecture over a non-pipelined one.arrow_forward
- Discuss the significance of the ALU's flags or condition code bits in CPU operations.arrow_forward7. Suppose the GPIO port F of the TIVA board has been properly initialized. A delay function is also provided. The delay is set to 0.1 sec for each function call. #define GPIO_PORTF_DATA_R (*((volatile unsigned long *)O×400253FC)) void Delay(void) {unsigned long volatile time; time = 1600000; // 0.1sec while(time){ time--; } Write embedded C code to generate a square wave on pin 5 of GPIO port F. The frequency of the square wave should be 1 Hz. 0.5 secarrow_forwardEach element in the table that contains the interrupt vectors corresponds to a separate data group.arrow_forward
- Computer architecturearrow_forwardDetermine the value of memory location 3001H. Given that initial value of register B = 3, C = 10 and E = 15. MOV A, B ANA C ANA E STA 3000H MOV A, B ORA C ORA E STA 3001H MOV A, B XRA C XRA E STA 3001H 02H OFH 06H 03Harrow_forwardFollowing the Marie Coding Rules, write a single Marie Subroutinecalled ‘MPY’ that will multiply two positive variables: MP1 and MP2and place the result in PROD1. One or both of the Input variablesmay be negative and MP2 could be zero!!Write a Marie program to input the two variables, determine their sign,force them to be positive and keep track of how many variables arenegative. If only one variable is negative, the result is negative!Then place the variables in the subroutines ‘input’ variables. ‘Call’ thesubroutine, get the result, and Display the three variables. Halt theprogram only when MP1 is zero, and do not ask for MP2!arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





