CS101 Solution - 01 Spring-2022 - by - Attiq Kundi

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Assignment No.

01 Solution
CS101-By Attiq Kundi
Changes karney k liye ctrl press kar kay Click Karen.

Solution Details

***.***
CS-101 Assignment No.01

BC********
Question No.01:
(a) Convert the above 8-digit binary numbers into decimals. (6 marks)

Solution:
(01001000)2 into decimal

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

= (0) + (64) + (0) + (0) + (8) + (0) + (0) + (0)

= 64 + 8

= 72
(01001000)2 = (72)10

(01101001)2 into decimal

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


= (0) + (64) + (32) + (0) + (8) + (0) + (0) + (1)

= 64 + 32 + 8 + 1

= 105
(01101001)2 = (105)10

(00101100)2 into decimal

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

= (0) + (0) + (32) + (0) + (8) + (4) + (0) + (0)

= 32 + 8 + 4

= 44
(00101100)2 = (44)10

(b) Convert the 8-digit binary into hexadecimal. (3 marks)

Solution:
(72)10 = ( )16
16 72

16 4 –––– 8

( 72 )10 = ( 48 )16

( 105 )10 = ( )16

16 105

16 6 –––– 9

( 105 )10 = ( 69 )16


(44)10 = ( )16

Hence 12 = C in Hexadecimal
16 44

16 2 ––– 12

( 44 )10 = ( 2C )16

(c) Decode the 8-digit binary in textual form. (Hint: using the ASCII table). (3 marks)

Solution:
8-digit binary in textual Formby using ASCII table.

8-digit binary 01001000 01101001 00101100

Decimal Notation 72 105 44

ASCII Table H i ,

Hi,

Question No.02:
The diagram below shows a circuit with four gates and four inputs (A, B, C and D). (3
marks)

If the final output is 0, what are the possible states of inputs A, B, C and D?
Solution:
A 1
B 1
C 1
D 1

Question No.03:
The following table lists the extensions of some file formats used by the website of
“Virtual University of Pakistan”. Match each extension to an example of data that it
can store:
Extension Example Answer

.mp3 The logo of the Virtual University of Pakistan .gif

.zip The photo of the Rector on the faculty page. .jpeg

.gif The audio tracks of programming talk- .mp3


throughs.
.jpeg A compressed folder of admission .zip
documents.

__________________________________________________________________
Assignment No.01
Solution by Attiq Kundi
SUBSCRIBE “Knowledge For Us” ON YOUTUBE
100 % CORRECT MCSQ
AND Many MoRe
Subject-CS101
Changes karney k liye ctrl press kar kay Click Karen

Solution Details

You might also like