Professional Documents
Culture Documents
Assignment No.1 IT430 Id: XXXXXXXX
Assignment No.1 IT430 Id: XXXXXXXX
com/
Assignment No.1
IT430
Id: xxxxxxxx
Question 1: (2+8)
a) In the following diagram find the shortest path and the alternate shortest path if a
client computer ’C’ on network 202.146 sends a request to the web server ‘B’ on network
100.
R4-R3-R1-R2 Alternative Shortest
Computer B
R4-R3-R1-R2 Alternative Shortest
Network#100
Router 1 Router 2
Computer C
R4-R2 Shortest path Network#202.146
Router 3 Router 4
b) Convert the following IP addresses from decimal to binary and binary to decimal
showing the steps involved.
a) 221.120.152.10 = (221)10. (120) 10.(152) 10.(10) 10
Solution:
Division Remainder, R
221 / 2 = 110 R=1
110 / 2 = 55 R=0
55 / 2 = 27 R=1
27 / 2 = 13 R=1
13 / 2 = 6 R=1
6/2=3 R=0
3/2=1 R=1
1/2=0 R=1
= 11011101
Division Remainder, R
120 / 2 = 60 R=0
60 / 2 = 30 R=0
30 / 2 = 15 R=0
15 / 2 = 7 R=1
7/2=3 R=1
3/2=1 R=1
1/2=0 R=1
= 1111000
Converting (152)10 decimal to binary
Division Remainder, R
152 / 2 = 76 R=0
76 / 2 = 38 R=0
38 / 2 = 19 R=0
19 / 2 = 9 R=1
9/2=4 R=1
4/2=2 R=0
2/2=1 R=0
1/2=0 R=1
= 10011000
Division Remainder, R
10 / 2 = 5 R=0
5/2=2 R=1
2/2=1 R=0
1/2=0 R=1
= 1010
b) 202.125.147.6 =?
Solution:
Division Remainder, R
202 / 2 = 101 R=0
101 / 2 = 50 R=1
50 / 2 = 25 R=0
25 / 2 = 12 R=1
12 / 2 = 6 R=0
6/2=3 R=0
3/2=1 R=1
1/2=0 R=1
= 11001010
Converting (125)10 decimal to binary
Division Remainder, R
125 / 2 = 62 R=1
62 / 2 = 31 R=0
31 / 2 = 15 R=1
15 / 2 = 7 R=1
7/2=3 R=1
3/2=1 R=1
1/2=0 R=1
= 1111101
Division Remainder, R
147 / 2 = 73 R=1
73 / 2 = 36 R=1
36 / 2 = 18 R=0
18 / 2 = 9 R=0
9/2=4 R=1
4/2=2 R=0
2/2=1 R=0
1/2=0 R=1
= 10010011
Division Remainder, R
6/2=3 R=0
3/2=1 R=1
1/2=0 R=1
= 110
c) ? = 01111001.01100100.11110110.00001010
Solution
0 1 2 3 4 5 6 7
(01111001)2 = 1*2 + 0*2 + 0*2 + 1*2 + 1*2 +1*2 +1*2 + 0*2
= 1*1 + 0 + 0 + 8 + 16 + 32 + 64 + 0
= 1 + 0 + 0 + 8 + 16 + 32 + 64 + 0
= 121
0 1 2 3 4 5 6 7
(01100100)2 = 0*2 + 0*2 + 1*2 + 0*2 + 0*2 +1*2 +1*2 + 0*2
= 0 + 0 + 4 + 0 + 0 + 32 + 64 + 0
= 100
0 1 2 3 4 5 6 7
(11110110)2 = 0*2 + 1*2 + 1*2 + 0*2 + 1*2 +1*2 +1*2 + 1*2
= 0 + 2 + 4 + 0 + 16 + 32 + 64 + 128
= 246
0 1 2 3 4 5 6 7
(00001010)2 = 0*2 + 1*2 + 0*2 + 1*2 + 0*2 +0*2 +0*2 + 0*2
=0+2+0+8+0+0+0+0
= 10
d) ? = 11001010.01111101.10001010.10011101
Solution
0 1 2 3 4 5 6 7
(11001010)2 = 0*2 + 1*2 + 0*2 + 1*2 + 0*2 +0*2 +1*2 + 1*2
= 0 + 2 + 0 + 8 + 0 + 0 + 64 + 128
= 202
0 1 2 3 4 5 6 7
(01111101)2 = 1*2 + 0*2 + 1*2 + 1*2 + 1*2 +1*2 +1*2 + 0*2
= 1 + 0 + 4 + 8 + 16 + 32 + 64 + 0
= 125
0 1 2 3 4 5 6 7
(10001010)2 = 0*2 + 1*2 + 0*2 + 1*2 + 0*2 +0*2 +0*2 + 1*2
= 0 + 2 + 0 + 8 + 0 + 0 + 0 + 128
= 138
0 1 2 3 4 5 6 7
(10011101)2 = 1*2 + 0*2 + 1*2 + 1*2 + 1*2 +0*2 +0*2 + 1*2
= 1 + 0 + 4 + 8 + 16 + 0 + 0 + 128
= 157
<html>
<head>
<title>IT430 </ title>
</ head >
<body bgcolor=blue text=white link=yellow>
Download Latest Songs<a href=http://songs.pk>songs.pk</a>
</body >
</html>
Confidential Page 5 10/27/2010
http://vujannat.ning.com/
b) Divide the browser window in 4 equal sized vertical frames. Also note that border
of the frame should be invisible and user should not be able to change the size of
frame.
<html>
<head><title>Vertical Frames</ title></ head >
<frameset cols ="15%, 15%, 15%, 15 %">
<frame noresize frameborder =0>
<frame noresize frameborder =0>
<frame noresize frameborder =0>
<frame noresize frameborder =0>
</ frameset >
</html >
c) Design a form in HTML that will contain two text boxes (ID, Password) and two
buttons (Submit, Reset) By clicking the submit button form should be submitted to
www.vu.edu.pk using POST method.
<body>
<h1>Form</h1>
<form action="http://www.vu.edu.pk" method="post">
<table>
<tr><td>I.D</td>
<td>
<input type="text" maxlength="12">
</td>
<tr>
<td>Password</td>
<td><input type="Password" maxlength="6"></td>
<tr>
<td><input type="submit" value="Submit"><input type="reset" value="Reset"></td>
</table>
</form>
</body>
</html>