You are on page 1of 4

Quest

ionsNo.01 Mar
ks(
12)

Ali
ceandBobar eplay
ingagamebyencodingthei
rmessagesinan8-bitbi
nary
.Trudy
wantstounderstandormodifythei
rmessages.Youhavet ohel
pTr udytoconv er
t
encodedmessagesint
oareadabl
eformatbyper
for
mingthefol
lowi
ngoperati
ons.

Encoded
01001000 01101001 00101100

BO Al
ice

Tr
ud
y

 Not
e:Per
for
m al
lther
equi
redst
epsi
ndet
ail
foreachoper
ati
on.

(
a)Conv
ertt
heabov
e8-
digi
tbi
nar
ynumber
sint
odeci
mal
s.
Sol
uti
on:

010010002=

0×27)+(
( 1×26)+(
0×25)+(
0×24)+(
1×23)+(
0×22)+(
0×21)+(
0×20)

=0+64+0+0+8+0+0+0

010010002=7210

011010012=
0×27)+(
( 1×26)+(
1×25)+(
0×24)+(
1×23)+(
0×22)+(
0×21)+(
1×20)

=0+64+32+0+8+0+0+1

011010012=10510

001011002=

0×27)+(
( 0×26)+(
1×25)+(
0×24)+(
1×23)+(
1×22)+(
0×21)+(
0×20)

=0+0+32+0+8+4+0

001011002=4410

(
B)Conv
ertt
he8-
digi
tbi
nar
yint
ohexadeci
mal
. (
3mar
ks)
Sol
uti
on:
Conv
ertbi
nar
yval
uet
oHexaDeci
mal
Val
ue
Spl
i
tthebi
nar
ynumberf
rom l
eftt
ori
ghteachgr
oup4bi
ts
8421
0100 1000
4 8
010010002=4816

Conv
ertbi
nar
yval
uet
oHexaDeci
mal
Val
ue
Spl
i
tthebi
nar
ynumberf
rom l
eftt
ori
ghteachgr
oup4bi
ts
8421
0110 1001
6 9
011010012=6916

Conv
ertbi
nar
yval
uet
oHexaDeci
mal
Val
ue
Spl
i
tthebi
nar
ynumberf
rom l
eftt
ori
ghteachgr
oup4bi
ts
8421
0010 1100
2 C
001011002=2C16

(
C)Decodethe8-
digi
tbi
nar
yint
ext
ual
for
m.(
Hint
:usi
ngt
heASCI
Itabl
e). (
3
marks)
01001000 01101001 00101100
ACSI
ICodes 72 105 44
H I ,
Text
ual
For
mis:Hi
,

Quest
ionsNo02 Mar
ks(
04)

Thedi
agr
am bel
owshowsaci
rcui
twi
thf
ourgat
esandf
ouri
nput
s(A,
B,CandD)
.

I
fthef
inal
out
puti
s0,
whatar
ethepossi
blest
atesofi
nput
sA,
B,CandD?

A 1
B 1
C 1
D 1
Quest
ionsNo.03 Mar
ks(
04)

Thef ol
lowi
ngtablel
i
ststheextensi
onsofsomefil
efor
matsusedbythewebsi
teof
“Vir
tualUni
ver
sit
yofPaki
stan”
.Matcheachext
ensi
ontoanexampl
eofdat
athati
tcan
store:

Ext
ensi
on Exampl
e Answer

.
mp3 Thel ogooft heVirt
ualUniv
ersit
yof .gif
Pakistan
.
zip The phot o oft he Rect
oron t he .
jpeg
facultypage.
.
gif The audi ot racks ofprogramming .mp3
tal
k-throughs.
.
jpeg A compr essedf ol
derofadmi ssi
on .zip
document s.

You might also like