Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi I have this Computer Organization Project. I need help. Project Description ject, you are expected to design and simulate a simple RISC processor that

Hi I have this Computer Organization Project. I need help. image text in transcribedimage text in transcribedimage text in transcribed

Project Description ject, you are expected to design and simulate a simple RISC processor that supports the following instructions: Arithmetic inst of which are source registers and the third is a destination register Load: involves one register only; it loads a word from memory at a given a ructions including addition and subtraction: involves three registers, two it to the register Load immediate: involves one register only; it loads a giv address en constant to the register t a given - Store: involves one register only; it stores the content of the register to memory a - Branch if equal: involves two registers; if their values are equal, branch to a given addres Branch if greater than: involves two registers; if the value of the first register is greater than the second, branch to a given address Jump: unconditional jump to a given address - Assume the processor has 8 general purpose 32-bit registers: Ro, R... R7, in addition to the program counter (PC) register, ZERO register, and memory buffer register (MBR) described below. The processor should support a byte-addressed memory with size 4KB and it is required that words are aligned in memory (i.e. 32-bit words start at an address that is divisible by 4). The control flow of the processor works in four stages: Fetch: at this stage, instructions are read from memory according to the value of the PC register. PC is then incremented. 1- 2- Decode: At this stage, the instruction's op-code is decoded. The processor will know what type of instruction will be executed, and the operands of the ALU are selected Execute: The instruction decoded in the previous stage is executed. Arithmetic operations on the selected operands are executed by the ALU. The load instruction loads the memory word from data memory to the memory buffer register (MBR). The store instruction loads the source's data into the MBR 4 Write back: This is the last stage where data is written to the instruction's destination. For the arithmetic operations, the destination must always be a register. The branch and jump instructions use this stage to update the value of the PC. As for load and store operations in this stage, the data in the MBR will be saved into its destination that is a register for the load instruction and a memory location for the store instruction Design 1. De sign the instruction structure by specifying the instruction fields and their sizes. Justify your design decisions 2. For each given instruction, define its syntax 3. Specify unique identifiers for the registers 4. For each type of instruction, describe in details the operation of one instruction using an and corresponding opcode. example. 5. Specify the automatic increment performed to the program counter 6. Sketch the datapath corresponding to each type of instruction In this phase, you need to simulate the designed processor. You are required to implement all given instructions. To implement the desired processor, you must first implement its components depending on their behavior: 1- Register: Saves a binary value presented at its input when its load signal is activated. 2- Memory: The processor should support a memory up to 4KB size but for your implementation, you may use smaller memory 3- Program Counter PC: the program counter is a special purpose register with an 4- ALU: takes two 32-bit binary operands and performs an arithmetic operation, 5- Multiplexer: Takes n inputs and outputs only one of these inputs, depending on the internal increment unit. depending on the operation select signal value of the select signal. You may use different types of multiplexers depending on your desigrn 6- Datapath: Contains instances of All registers. General-purpose registers get their inputs either from the ALU utput, or from the MBR. The MBR, on the other hand, has its input either from one of the general-purpose registers, or from memory An ALU. b. Multiplexers required to: 1) Select the operands of the ALU, 2) Select the input urce of the register, 3) Select the input source of the program counter, and 4) Select the input source of the MBR. 7- Control Unit: It is responsible for the control flow of the program, by guiding the data path's control signals throughout the fetch, decode, execute, and write back stages. It chooses the registers to be read from, the operation to be executed in the ALU, the registers to be saved to, and the multiplexers' select values. It chooses all of these depending on the op-code it reads at the location pointed to by the value in the PC, and stops execution once a halt statement is encountered. 8- Microprocessors: It is the main component, which has an instance of the data-path, and an instance of the control unit. Initialization Before the microprocessor starts operation. You need to initialize general-purpose registers with zero upon starting the microprocessor and initialize memory with the required values of instructions. You need to write an assembler function that reads the assembly code (from a given file) and initializes program memory automatically Output Once the microprocessor starts operation, your program should display content of all registers and memory and update those values upon executing every instruction. For the demonstration, prepare a C program that includes a for loop, convert into assembly and then into machine code using the assembler. Include this program in the report together with its generated output Project Description ject, you are expected to design and simulate a simple RISC processor that supports the following instructions: Arithmetic inst of which are source registers and the third is a destination register Load: involves one register only; it loads a word from memory at a given a ructions including addition and subtraction: involves three registers, two it to the register Load immediate: involves one register only; it loads a giv address en constant to the register t a given - Store: involves one register only; it stores the content of the register to memory a - Branch if equal: involves two registers; if their values are equal, branch to a given addres Branch if greater than: involves two registers; if the value of the first register is greater than the second, branch to a given address Jump: unconditional jump to a given address - Assume the processor has 8 general purpose 32-bit registers: Ro, R... R7, in addition to the program counter (PC) register, ZERO register, and memory buffer register (MBR) described below. The processor should support a byte-addressed memory with size 4KB and it is required that words are aligned in memory (i.e. 32-bit words start at an address that is divisible by 4). The control flow of the processor works in four stages: Fetch: at this stage, instructions are read from memory according to the value of the PC register. PC is then incremented. 1- 2- Decode: At this stage, the instruction's op-code is decoded. The processor will know what type of instruction will be executed, and the operands of the ALU are selected Execute: The instruction decoded in the previous stage is executed. Arithmetic operations on the selected operands are executed by the ALU. The load instruction loads the memory word from data memory to the memory buffer register (MBR). The store instruction loads the source's data into the MBR 4 Write back: This is the last stage where data is written to the instruction's destination. For the arithmetic operations, the destination must always be a register. The branch and jump instructions use this stage to update the value of the PC. As for load and store operations in this stage, the data in the MBR will be saved into its destination that is a register for the load instruction and a memory location for the store instruction Design 1. De sign the instruction structure by specifying the instruction fields and their sizes. Justify your design decisions 2. For each given instruction, define its syntax 3. Specify unique identifiers for the registers 4. For each type of instruction, describe in details the operation of one instruction using an and corresponding opcode. example. 5. Specify the automatic increment performed to the program counter 6. Sketch the datapath corresponding to each type of instruction In this phase, you need to simulate the designed processor. You are required to implement all given instructions. To implement the desired processor, you must first implement its components depending on their behavior: 1- Register: Saves a binary value presented at its input when its load signal is activated. 2- Memory: The processor should support a memory up to 4KB size but for your implementation, you may use smaller memory 3- Program Counter PC: the program counter is a special purpose register with an 4- ALU: takes two 32-bit binary operands and performs an arithmetic operation, 5- Multiplexer: Takes n inputs and outputs only one of these inputs, depending on the internal increment unit. depending on the operation select signal value of the select signal. You may use different types of multiplexers depending on your desigrn 6- Datapath: Contains instances of All registers. General-purpose registers get their inputs either from the ALU utput, or from the MBR. The MBR, on the other hand, has its input either from one of the general-purpose registers, or from memory An ALU. b. Multiplexers required to: 1) Select the operands of the ALU, 2) Select the input urce of the register, 3) Select the input source of the program counter, and 4) Select the input source of the MBR. 7- Control Unit: It is responsible for the control flow of the program, by guiding the data path's control signals throughout the fetch, decode, execute, and write back stages. It chooses the registers to be read from, the operation to be executed in the ALU, the registers to be saved to, and the multiplexers' select values. It chooses all of these depending on the op-code it reads at the location pointed to by the value in the PC, and stops execution once a halt statement is encountered. 8- Microprocessors: It is the main component, which has an instance of the data-path, and an instance of the control unit. Initialization Before the microprocessor starts operation. You need to initialize general-purpose registers with zero upon starting the microprocessor and initialize memory with the required values of instructions. You need to write an assembler function that reads the assembly code (from a given file) and initializes program memory automatically Output Once the microprocessor starts operation, your program should display content of all registers and memory and update those values upon executing every instruction. For the demonstration, prepare a C program that includes a for loop, convert into assembly and then into machine code using the assembler. Include this program in the report together with its generated output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions