0% found this document useful (0 votes)
72 views3 pages

Semester Spring 2022 CS101 Assignment No. 1 Reem Farooq ID: bc220200597

The document discusses helping Trudy convert encoded messages between Alice and Bob. It provides examples of: 1) Converting 8-digit binary numbers to decimal by performing binary to decimal conversions. 2) Converting the same 8-digit binary numbers to hexadecimal by grouping the digits and matching them to hexadecimal values. 3) Decoding the 8-digit binary numbers into text form by looking up the decimal values in the ASCII table. The examples show binary numbers being converted to decimal 72, 105, and 44 then decoded as the text "Hi,".

Uploaded by

fatima shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views3 pages

Semester Spring 2022 CS101 Assignment No. 1 Reem Farooq ID: bc220200597

The document discusses helping Trudy convert encoded messages between Alice and Bob. It provides examples of: 1) Converting 8-digit binary numbers to decimal by performing binary to decimal conversions. 2) Converting the same 8-digit binary numbers to hexadecimal by grouping the digits and matching them to hexadecimal values. 3) Decoding the 8-digit binary numbers into text form by looking up the decimal values in the ASCII table. The examples show binary numbers being converted to decimal 72, 105, and 44 then decoded as the text "Hi,".

Uploaded by

fatima shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

SEMESTER SPRING 2022

CS101
ASSIGNMENT NO. 1
REEM FAROOQ
ID: bc220200597

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.

Answer:

 01001000
(0×2⁷)+(1×2⁶)+(0×2⁵)+(0×2⁴)+(1×2³)+(0×2²)+(0×2¹)+(0×2⁰)
= 0+64+0+0+8+0+0+0
= 64+8
=72
= (01101001)² = 72¹⁰

 (01101001)²

(0×2⁷)+(1×2⁶)+(1×2⁵)+(0×2⁴)+(1×2³)+(0×2²)+(0×2¹)+(1×2⁰)
= 0+64+32+0+8+0+0+1
=64+32+8
=105
= (01101001)² = 105¹⁰

 (00101100)²

(0×2⁷)+(0×2⁶)+(1×2⁵)+(0×2⁴)+(1×2³)+(1×2²)+(0×2¹)+(0×2⁰)
= 0+0+32+0+8+4+0+0
= 32+8+4
= 44
= (00101100)² = 44²

b) Convert the 8-digit binary into hexadecimal.    


                                        
 01001000
By intersect 01001000 in groups:

0100 1000
4 4

01001000² = 4816

  01101001

 By intersect 01101001 in groups:

0110 1001
6 9
 
01101001²  =6916
 
 00101100

 By intersect 00101100 in groups:

0010     1100


2 c

00101100 ² = 2c16

b) Decode the 8-digit binary in textual form.

By using the ASCII table.

Binary 01001000 01101001 00101100


Form
Textual 72 105 44
Form
ASCII H i ,
FORM

Answer in textual form is =Hi,

You might also like