Semester Spring 2022 CS101 Assignment No. 1 Reem Farooq ID: bc220200597
Semester Spring 2022 CS101 Assignment No. 1 Reem Farooq ID: bc220200597
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
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²
0100 1000
4 4
01001000² = 4816
01101001
0110 1001
6 9
01101001² =6916
00101100
00101100 ² = 2c16