CS401 - Computer Architecture and Assembly Language Programming
2
Topics
18
Posts
Q. In the last 60 years, computer processors have been evolving and processing speed has increased multiple times. Increasing processor speed along with increasing the number of processing cores has been the major trend. As a computer architect, we have an option of either increasing the number of cores to achieve better performance or increasing the processing speed of a single processor.
What would be your choice to go with in the prevailing scenario keeping in view the pros and cons of each approach? Provide logical reasoning in either case.
Re: CS401 Assignment 2 Solution and Discussion
CS401 Computer Architecture and Assembly Language Programming Assignment 2 Solution & Discussion Spring 2020
Computer Architecture and Assembly Language Programming (CS401)
Assignment # 02
Total marks = 20 Deadline Date June 12th, 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 concern 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.
Topic Covered:
Addressing Modes
Branching
Subroutines
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 people 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: cs401@vu.edu.pk
Q1. Write a subroutine that will take two arrays Array1 & Array2. Array1 will contain uppercase alphabets from A-M and the Array2 will contain lower case alphabets from n-z. Your subroutine should work in such a way that it will convert array1 elements to lower case and array2 elements to uppercase and populate them in a 3rd array. (Marks 20)
For example:
Array1 = A,B,C,D,E,F,G,H,I,J,K,L,M
Array2= n,o,p,q,r,s,t,u,v,w,x,y,z
Output should be:
Array3= a,b,c,d,e,f,g,h,I,j,k,l,m,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
Note: You can consult to alphabet’s ASCII values through this link:
Re: CS401 Assignment 1 Solution and Discussion
Computer Architecture and Assembly Language Programming (CS401)
Assignment # 01
Total marks = 20
Deadline Date
June 1, 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 concern 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.
Topic Covered:
• Segmented Memory Model
• Addressing Modes
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 people 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:
cs401@vu.edu.pk
Q 1. Calculate the effective address for the following set of values. (5)
Code Segment = 6032h
BX = 3060h
DI = 4001h
Offset = 0470h
Q 2. Find the physical Address, if segment address is FF01H and offset is FF02H.(7)
Q 3. Calculate the offset when the physical address is 003Ch and the contents of segment register are 003Ah. (8)
“The End”
Computer Architecture and Assembly Language Programming (CS401)
Assignment # 02
Total marks = 20
Deadline Date
Nov 26, 2019
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 concern 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.
Topic Covered:
• Addressing Modes
• Branching
• Subroutines•
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 people 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:
cs401@vu.edu.pk
Q1. Write a subroutine that will find the first even number from an array of your VU ID and calculate its factorial. (10 Marks)
Note: Skip 0’s in your VU ID as shown below,
VU ID: BC190206435
After skipping 0’s, array would be:
Array: 1, 9, 2, 6, 4, 3, 5
The first even number is 2 in the array so its factorial will be calculated and saved in AX register.
Q2. Write a code in assembly language (using appropriate jumps) equivalent to this given code in C. (10 Marks)
#include <stdio.h>
int main()
{
int n1=1, n2=2;
int largest;
if( n1>n2)
largest=n1;
else
largest = n2;
return 0;
}
“The End”
Computer Architecture and Assembly Language Programming (CS401)
Assignment # 03
Total marks = 20
Due Date:
January 20, 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 concern 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.
Topic Covered:
• BIOS VIDEO SERVICES AND GRAPHICS MODE SERVICES
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 people 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 cs401@vu.edu.pk
Question Statement
Suppose we want to draw a square on our computer screen as shown below.
[image: fD5FO2u.png]
You are required to write an assembly language program to draw a square as given above using video interrupts.
Note:
a. Upper horizontal line must be Green
b. Lower horizontal line must be blue
c. Left vertical line must be PINK
d. Right vertical line must be Gray.
“The End”
