Showing posts with label Solutions. Show all posts
Showing posts with label Solutions. Show all posts

CS401 Assignment no 3 - Graded assignment

By: // No comments:

CS401 Assignment no 3 

CS401 Graded Assignment no 3 Computer Architecture & Assembly Language

Download Attachment:

Computer Architecture & Assembly Language (CS401)
Assignment # 3(Graded)
Total marks = 20
                                                                                  Deadline Date = July22, 2015
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.

1)      You should concern the recommended books to clarify your concepts as handouts are not sufficient.
2)      You are supposed to submit your assignment in .ppt or pptxformat. Any other formats like scan images, PDF, zip, rar, doc and bmp etc will not be accepted.
Topic Covered:
  • Display Memory
  • String Instruction
  • Software Interrupt
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.
For any query, feel free to email at:

Question Statement:
You are required to write an assembly language program that prints your FULL NAME along with your VU-ID.
You have to use simple Display Memory addressing instructions and attribute setting mechanism (no need to use any subroutine) to print above in the following pattern.

CS506 Assignment # 1 Web Design and Development

By: // 3 comments:
Problem Statement:
You are required to Install/configure the JDK(Java Development Kit) on your system and create the simple Java Program that displays your name and VUID in the command prompt.
Detailed Description:
Firstly install and configure the JDK on your system, so that you can compile and run the Java program in command prompt.
For this purpose you have to set the following environment variable.
  • PATH variable
After installing the JDK, by setting the above environment variable, you are required to test JDK, by typing the following command incommand prompt
If you have correctly installed the JDK then followingmessage should be displayed in your command prompt.

Now you can compile/run the java program,
You are required to write the simple Java Program that will display your nameand yourVUID in the command prompt.

For creating a simple java program you are required to perform the following steps on your system.

  • Install and configureJDK.
  • Set the environment variable PATH
  • Write the simple java program in notepad and save it with your VUID, suppose you have saved your java programas “” in some directory.  Make sure to add double quotes around java program name while saving your program in notepad.  For example create a folder known as “Assignment” in E: drive and save you program at path E:\Assignment

After performing the above three steps type the following command in command prompt as follows.

E:\>cd Assignment
E:\Assignment>java mc123456789
Muhammad Ali

As a result in command prompt your nameand VUID should be displayed
Note: you can save your program in any drive and folder but name of your java file should be your own VUID

Sample Output:

You have to send the following things in assignment.
Screen Shot ofCommand Prompt:
Screen shot of command prompt, after writing the java or javac command in command prompt, as follows.

Screenshot of command prompt window when you compile/run your java program it should displayyour nameandVUIDin the command prompt as follows.
E:\Assignment>java mc123456789
Muhammad Ali
Note: You can get the screen shot of any active window by pressing Alt+PrtScnkey.
Java Program:
Write the Java program and save it with your own VUIDlikems123456789.javatodisplay yournameandVUIDin the command prompt and send the code in the same word file, there is no need to send the java program in separate file you can send the code in same word file.
Note: you are required to send above things in a single Word File. i.e. (Screen shot of output window when you type java or javac in command prompt,screen shot of compiling/running of your program and thejava program code).

CS401 Assignment No 1 Solution

By: // No comments:
CS401 - Computer Architecture and Assembly Language Programming Assignment No. 1


CS401 Assignment  Solution

CS401 Assignment Part 1.

You are required to calculate Physical Addresses for the following two combinations:
1.      BX+SI+0xFF00
2.      BP+DI+0xA000


First of all wo calculate the Effective Address(EF).
In snapshot the value of BX = 0000 and SI = 01A2
Effective Address =  BX + SI + 0x0FF00
EF = 0000 + 01A2 + 0x0FF00
EF = 100A2
Now we compute the Physical Address
For BX and SI the default segment is DS
In snapshot the value of DS = 0A2E

Physical Address = DS * 10H + EF
Physical Address = 0A2E*10H + 100A2
Physical Address = A2E0 + 100A2
Physical Address = 1A382H

CS401 Assignment Part 2.

Question 2:
Assume the following Pseudo Code and convert it into proper assembly language instructions that should be assembled and debugged using NASM.

1.      Declare an array named as P_NUM of 5 elements that contains first five prime numbers.
2.      Set CX to 5 in decimal.
3.      Move the first element of P_NUM array to the AX.
4.      Move the fourth element of P_NUM array to the BX.
5.      Move last element from P_NUM array to the DX.
6.      Add the values of AX and BX and store the result in AX.
7.      Add the values of new AX and DX and store the result in BX.

  1. BP+DI+0xA000
In snapshot the value of BP = 0000 and DI = 000A
Now the calculate the Effective Address(EF).

Effective Address = BP+DI+0xA000
EF = 0000 + 000A + 0x0A000
EF = A00A
Now we compute the Physical Address
In snapshot the Default segment of  BP is SS
The value of SS is given in snapshot SS = 12A1

Physical Address = SS*10H + EF
Physical Address = 12A1*10 + A00A
Physical Address = 12A10 + A00A
Physical Address = 1CA1A
Answer 2.

[org 0x100]

mov cx, 5
mov ax, [P_NUM]
mov bx, [P_NUM+6]
mov dx, [P_NUM+8]

add ax,bx
add ax,dx

mov bx, ax

mov ax, 0x4c00
int 0x21

P_NUM:   dw 2,3,5,7,11

cs101 assignment no 2 solution-Query

By: // No comments:
Question No 1:                                                                                                                     Marks 10
In figure 1, some sort of CV template is given. You are required to re-write/type the shown template using built in MS word functionality with same background as in the image for specific text.
Question No.2 
comprises of two parts i.e. Practice part & Submission part.  Practice part is for your practice and the the code is given below. As for as the  Submission part is concerned, you will attempt it (Submission part) by following the same HTML code as mentioned in Practice part.


See the attached file for Soultion

CS101 Question 1 Solution

Practice Part
This is practice assignment

Student ID: BC130201551

Web Address:                                              mydomain

Submission Part

This will be your actual assignment

Personal Profile

Enthusiastic, reliable and friendly individual who works hard to achieve his/her goals. A quick 
learner who is always seeking learning opportunities.

© Virtual University of Pakistan

Email address:


 1st.      Matriculation
2nd.     Higher Secondary Education
 3rd.     Bachelors

Question 2 Solution

<title>Assignment No. 02</title>
<h1 align="center">Personal Profile</h1>
<table align="center"
<table style="width:46%">
<input type="text"name="userName"size="20"></td></tr>
<tr><td>Favourite Drink:</td>
<td><select name="drinks">
<option value="tea">Tea</option>
<option value="coffee">Coffee</option>
<option value="softdrink">Soft Drink</option>
<option value="blank"selected>Select from given list</option>
<tr><td align="left"><h3>Submission Part</h3></td></tr>s
<tr><td><b> Skills </b></td><td>
<OL type ="i">
<li> MS Office </li>
<li> Adobe Photoshop </li>
<li> HTML </li>
<tr><td><b> Hobbies </b></td><td>
<UL type ="bullet">
<li> FootBall </li>
<li> Hockey </li>
<li> Cricket </li>
<table align="center"
<tr><td><b> Define Yourself </b></td><td>
<tr><td><ul>You have to write about yourself in maximum 200 words</ul></td></tr>
<tr><td><input type="reset"
value="Reset All Preferences">

Dear students!
It has been observed that students are having confusion about the submission format of assignment 2. Please note that you are required to submit complete solution of assignment 2 in Microsoft Word file (.doc format). i.e. both questions on same MS word file. You are not required to submit any separate html file. Instead you can provide your HTML code in the same Word file.
Try to attempt your assignment as soon as possible in order to avoid any inconvenience. No assignment will be accepted through email.
For any queries, kindly email us at