Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Lab Assignment: Computer Organization and Design

This lab introduces the idea of the pipelining technique for building a fast CPU. The students will obtain experience with the design implementation and testing of the first two stages (Instruction Fetch, Instruction Decode) of the five-stage pipelined CPU using the Xilinx design package for FPGAs. It is assumed that students are familiar with the operation of the Xilinx design package for Field Programmable Gate Arrays (FPGAs) through the Xilinix tutorial available in the class website.

1. Pipelining

Pipelining is an implementation technique in which multiple instructions are overlapped in execution. The five- stage pipelined CPU allows overlapping execution of multiple instructions. Although an instruction takes five clock cycle to pass through the pipeline, a new instruction can enter the pipeline during every clock cycle. Under ideal circumstances, the pipelined CPU can produce a result in every clock cycle. Because in a pipelined CPU there are multiple operations in each clock cycle, we must save the temporary results in each pipeline stage into pipeline registers for use in the follow-up stages. We have five stages: IF, ID, EXE, MEM, and WB. The PC can be considered as the first pipeline register at the beginning of the first stage. We name the other pipeline registers as IF/ID, ID/EXE, EXE/MEM, and MEM/WB in sequence. In order to understand in depth how the pipelined CPU works, we will show the circuits that are required in each pipeline stage of a baseline CPU.

2. Circuits of the Instruction Fetch Stage

The circuit in the IF stage are shown in Figure 2. Also, looking at the first clock cycle in Figure 1(b), the first lw instruction is being fetched. In the IF stage, there is an instruction memory module and an adder between two pipeline registers. The left most pipeline register is the PC; it holds 100. In the end of the first cycle (at the rising edge of clk), the instruction fetched from instruction memory is written into the IF/ID register. Meanwhile, the output of the adder (PC + 4, the next PC) is written into PC.

3. Circuits of the Instruction Decode Stage

Referring to Figure 3, in the second cycle, the first instruction entered the ID stage. There are two jobs in the second cycle: to decode the first instruction in the ID stage, and to fetch the second instruction in the IF stage. The two instructions are shown on the top of the figures: the first instruction is in the ID stage, and the second instruction is in the IF stage. The first instruction in the ID stage comes from the IF/ID register. Two operands are read from the register file (Regfile in the figure) based on rs and rt, although the lw instruction does not use the operand in the register rt. The immediate (imm) is sign- extended into 32 bits. The regrt signal is used in the ID stage that selects the destination register number; all others must be written into the ID/EXE register for later use. At the end of the second cycle, all the data and control signals, except for regrt, in the ID stage are written into the ID/EXE register. At the same time, the PC and the IF/ID register are also updated.

Figure 1 Timing chart comparison between two types of CPUs

Figure 2 Pipeline instruction fetch (IF) stage

Figure 2 Pipeline instruction decode (ID) stage

4. Table 1 lists the names and usages of the 32 registers in the register file.

Table 1 MIPS general purpose register

Register Name

Register Number

Usage

$zero

0

Constant 0

$at

1

Reserved  for assembler

$v0, $v1

2, 3

Function return values

$a0  - $a3

4 - 7

Function argument values

$t0  - $t7

8 - 15

Temporary (caller saved)

$s0  - $s7

16  - 23

Temporary (callee saved)

$t8, $t9

24, 25

Temporary (caller saved)

$k0, $k1

26, 27

Reserved  for  OS Kernel

$gp

28

Pointer to Global Area

$sp

29

Stack Pointer

$fp

30

Frame Pointer

$ra

31

Return Address

5. Table 2 lists some MIPS instructions that will be implemented in our CPU Table 2 MIPS integration instruction

6. Initialize the first 10 words of the Data memory with the following HEX values:

A00000AA 10000011
20000022
30000033
40000044
50000055
60000066
70000077
80000088
90000099

7. Write a Verilog code that implement the following instructions using the design shown in Figure 2 and Figure 3. Write a Verilog test bench to verify your code: (You have to show all the signals written into the IF/ID register and the ID/EXE register in your simulation outputs)

# address

instruction

comment

100:

lw $v0, 00($at)

# $2 ←←   memory[$1+00]; load x[0]

104:

lw $v1, 04($at)

# $3 ←←  memory[$1+04]; load x[1]

Assume that the register $at has the value of 0

8. Write a report that contains the following:

a. Your Verilog design code. Use:

i. Device: XC7Z010- -1CLG400C

b. Your Verilog Test Bench design code. Add "`timescale 1ns/1ps" as the first line of your test bench file.

c. The waveforms resulting from the verification of your design with ModelSim showing all the signals written into the IF/ID register and the ID/EXE register.

d. The design schematics from the Xilinx synthesis of your design. Do not use any area constraints.

e. Snapshot of the I/O Planning and

f. Snapshot of the floor planning

9. REPORT FORMAT: Free form, but it must be:

g. One report per student.

h. Have a cover sheet with identification: Title, Class, Your Name, etc.

i. Using Microsoft word and it should be uploaded in word format not PDF. If you know LaTex, you should upload the Tex file in addition to the PDF file.

j. Double spaced

10. You have to upload the whole project design file zipped with the word file.

Attachment:- Lab_Assignment.pdf

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92263430

Have any Question?


Related Questions in Computer Engineering

Design layout reference mailings review view consolas 105 a

Design Layout Reference Mailings Review View Consolas 10.5 A. A Styles styles H- 1. Report the total payments by date when the total payments are greater than $20,000. 2. List the amount paid by each customer who has pai ...

String loop method write a java program to meet the

((String + Loop + method) Write a Java program to meet the following requirements: 1. Prompt the user to enter three strings by using nextline(). Space can be part of the string. 2. Write a method with an input variable ...

C programmingneed help with a c program arrayrearrangec

***C PROGRAMMING*** Need help with a C program array_rearrange.c that rearranges an integer array. The array will be split into two sets of integers one by one. A new array will be created by append the first set to the ...

The measurements of the diametersnbspin inches of 12

The measurements of the diameters? (in inches) of 12 randomly chosen golf balls are listed. At alpha (α) = 0.05?, is there enough evidence to reject the claim that the standard deviation of the measurements of these diam ...

Problemtelephone calls arrive at the rate of 12 per hour at

Problem Telephone calls arrive at the rate of 12 per hour at the reservation desk for Regional Airways. a. Find the probability of receiving 3 calls in a 4-minute interval. If required, round your answer to four decimal ...

A humane society claims that less thannbsp33 of us

A humane society claims that less than 33?% of U.S. households own a dog. In a random sample of 409 U.S.? households, 155 say they own a dog. At alpha(α) = 0.04?, is there enough evidence to support the? society's claim? ...

Display the employee titles whose department is located in

Display the employee titles whose department is located in a secret cave.

We are evaluating a project that costsnbsp1140000 has a

We are evaluating a project that costs $1,140,000, has a ten-year life, and has no salvage value. Assume that depreciation is straight-line to zero over the life of the project. Sales are projected at 51,000 units per ye ...

Is smartart graphic and table slide important for

Is Smartart graphic and Table slide important for PowerPoint Presentation? How would it benefit?

Question provide a real-world example or describe a

Question: Provide a real-world example or describe a hypothetical situation in which a legitimate organization used spam in an effective and nonintrusive manner to promote a product or service. Need 300-350 words APA sta ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As