You are on page 1of 2

Introduction to Computing (CS101) Total marks = 20

Assignment # 01 Deadline Date


Spring 2022 June 17, 2022

Question no.1
Alice and Bob are playing a game by encoding their messages in an 8-bit binary. Trudy
wants to understand or modify their messages. You have to help Trudy to convert encoded
messages into a readable format by performing the following operations.
(a) Convert the above 8-digit binary numbers into decimals.
(6 marks)

solution
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
001011 002=
(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)Convert the 8-digit binary into hexadecimal .


Solution:

Convert binary value to Hexa Decimal Value


Split the binary number from left to right each group 4
bits8421
0100 1000
4 8
010010002= 48
Convert binary value to Hexa Decimal Value
Split the binary number from left to right each group 4
bits8421
0110 1001
6 9
011010012= 69
Convert binary value to Hexa Decimal Value
Split the binary number from left to right each group 4
bits8421
0010 1100
2 C
001011002= 2C

© Decode the 8-digit binary in textual form. (Hint: using the ASCII table).
Solution:
01001000 01101001 00101100
ACSII Codes 72 105 44
H i ,
Textual Form is: Hi,

ANSWER NO .2.

A 1
B 1
C 1
D 1
ANSWER NO.3:

Extensio Example Answer


n
.mp3 The logo of the Virtual University of The audio track of programing
Pakistan talk- through
.zip The photo of the Rector on the faculty A compressed folder of admission
page. .
.gif The audio tracks of programming talk- The logo of the virtual university
throughs. of Pakistan.
.jpeg A compressed folder of admission The photo of the rector on the
documents. faculty page

You might also like