0% found this document useful (0 votes)
20 views2 pages

Spring 2024 - CS501 - 1 - SOL

Uploaded by

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

Spring 2024 - CS501 - 1 - SOL

Uploaded by

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

Advance Computer Architecture Total marks = 20

Deadline
(CS501) nd
2 of May 2024
Assignment # 01
Spring 2024
Please carefully read the following instructions before attempting the 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 the file is corrupted.
 Strict action will be taken if the submitted solution is copied from any other student or the
internet.

You should consult the recommended books to clarify your concepts, as handouts are insufficient.
You are supposed to submit your assignment in Doc or Docx format.
Any other formats like scanned images, PDF, ZIP, RAR, PPT, BMP, etc. will not be accepted.

Topic Covered:
The objective of this assignment is to assess the understanding of students about:
 Instruction Set Architecture
 SRC
 Addressing Modes
 Different type of Instructions
 Different Operations

Topic Covered
Lecture # 1 to Lecture # 11

NOTE

No assignment will be accepted via email after the due date (whether it is due to load shedding, internet
malfunctioning, etc.). Hence, refrain from uploading assignments within the last hour of the deadline. It is
recommended that the solution be uploaded at least two days before its closing date.

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

For any query, feel free to email me at:


[email protected]
Tasks Total Marks (20)

Question No 01:
Write an SRC (Simple Risc Computer) assembly language program to evaluate the following expression.
F= (a+2000) – 4(b+100)
Assume that Variables declaration will start at memory address 100 and program instructions will be
stored at memory address starting from 300.
You need to comment each line of your code to explain its purpose and also identify the instruction type of
each instruction. Your solution should be in following format:
Solution:
Instuction Comment SRC Instruction Type
Ld R1, b Load value of b in R1 Data Transfer
Addi R3, R1, 100 Add 100 and R1 and assign to R3 Arithmetic
Shl R6, R3, 2 Multiply R3 by 4 and add in R6 Arithmetic
Ld R4, a Load value of a in R4 Data Transfer
Addi R7, R4, 2000 Add 2000 and R4 and assign to R7 Arithmetic
Sub R8, R7, R6 Subtract R6 from R7 and assign to R8 Arithmetic
St R8,F Store the value of variable f in R8 Data Transfer

Question No 022
Fill the following table on the basis of memory addresses for data and code mentioned in Question 01.
Solution:
Memory Address Labels Memory Value
100 b Unknown
104 a Unknown
108 F Unknown
---- ----
300 Ld R1, b
304 Addi R3, R1, 100
308 Shl R6, R3, 2
312 Ld R4, a
316 Addi R7, R4, 2000
320 Sub R8, R7, R6
324 St R8,F

You might also like