0% found this document useful (0 votes)
51 views3 pages

Assignment # 01: Spring 2020

The document provides instructions for Assignment #01 in the course Advance Computer Architecture (CS501) including rules for marking, objectives, notes, and questions. It specifies a deadline of June 1st 2020 and rules such as assignments must be in .doc or .docx format and no late assignments will be accepted. Question 1 asks to write assembly code for a 2-address and 3-address machine to evaluate an expression. Question 2 asks to calculate the execution time for the code on each machine type based on instruction count, clock period, and clock per instruction values provided.

Uploaded by

akcent
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views3 pages

Assignment # 01: Spring 2020

The document provides instructions for Assignment #01 in the course Advance Computer Architecture (CS501) including rules for marking, objectives, notes, and questions. It specifies a deadline of June 1st 2020 and rules such as assignments must be in .doc or .docx format and no late assignments will be accepted. Question 1 asks to write assembly code for a 2-address and 3-address machine to evaluate an expression. Question 2 asks to calculate the execution time for the code on each machine type based on instruction count, clock period, and clock per instruction values provided.

Uploaded by

akcent
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Advance Computer Architecture (CS501) Total marks = 20

Assignment # 01 Deadline Date

Spring 2020 1st June 2020

Please carefully read the following instructions before attempting assignment.

RULES FOR MARKING


It should be clear that your assignment would not get any credit if:
 The assignment is submitted after the due date.
 The submitted assignment does not open or file is corrupt.
 Strict action will be taken if submitted solution is copied from any other student or from
the internet.

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

You are supposed to submit your assignment in .doc or docx format.


Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.

Objective:

Objective of this assignment is to increase the learning capabilities of the students about

 Classification of Instruction Set Architecture for different machines


 Performance Measurement of a processor
 Comparison of Processors’ performance

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of
load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last
hour of deadline. It is recommended to upload solution file at least two days before its closing date.

If you find any mistake or confusion in assignment (Question statement), please consult with your
instructor before the deadline. After the deadline no queries will be entertained in this regard.

For any query, feel free to email at:


[email protected]
Question No - 1 12 marks

Write assembly code for 2-address and 3-address machines to evaluate the given expression:

z = x2 - 3xy + 2(x/y) + y2

Note: x, y and z are memory locations


Solution:

3-Address 2-Address
mul a, x, x load z, x
mul b, x, y mul z, x
mul c, b, 3 load a, x
sub d, a, c mul a, y
div r, x, y mul a, 3
mul s, r, 2 sub z, a
add t d, s load c, x
mul e, y, y div c, y
add z, t, e mul c, 2
add z, c
load d, y
mul d, y
add z, d

Question No - 2 8 marks

For the above given expression, calculate the time required to execute the code for 2-address and
3-address machines by considering the following parameters:
SOLUTION:
Clock Period
Machine Type Average CPI Processor Frequency
5ns
2-address 3 200 MHz
4ns
3-address 5 250 MHz

When Program execute on 2-address machine:


Instruction count (IC) = 13.0
Clock Per Instruction (CPI) = 3
Clock Period (T) = 1/(200*106) = 0.000000005 = 5 ns
Execution time (ET) = ?
We Know that

ET = IC * CPI * T
= 13 * 3 * 5
ET = 195 ns

This means that address-2 will take 195 ns to execute program.

When Program execute on 3-address machine:


Instruction count (IC) = 9.0
Clock Per Instruction (CPI) = 5
Clock Period (T) = 1/(250*106) = 0.000000004 = 4 ns
Execution time (ET) = ?

We Know that

ET = IC * CPI * T
= 9*5*4
ET = 180 ns

This means that address-3 machine will take 180 ns to execute program.

You might also like