Docsity

Homework for CENG 244, Exercises of Computer Engineering and Programming

Toggle sidebar
bg1
1. Convert 101.5937510 to base 2 and 16
Binary
101.5937510
Number Remainder
101/2 = 50 1 a0 = 1
50/2 = 25 0 a1 = 0
25/2 = 12 1 a2 = 1
12/2 = 6 0 a3 = 0
6/2 = 3 0 a4 = 0
3/2 = 1 1 a5 = 1
1/2 = 0 1 a6 = 1 whole number part = 11001012
Fraction Whole
0.59375*2 = 0.1875 1 a-1 = 1
0.1875*2 = 0.375 0 a-2 = 0
0.375*2 = 0.75 0 a-3 = 0
0.75*2 = 0.5 1 a-4 = 1
0.5*2 = 0 1 a-5 = 1 fraction part = 0.100112
Answer = 1100101.100112
Hexadecimal
Algorithmic Solution:
101.5937510
Number Remainder
101/16 = 6 5 a0 = 5
6/16 = 0 6 a1 = 6 whole number part = 6516
pf3

Partial preview of the text

Download Homework for CENG 244 and more Exercises Computer Engineering and Programming in PDF only on Docsity!

  1. Convert 101.59375 10 to base 2 and 16

Binary

Number Remainder 101/2 = 50 1 a 0 = 1 50/2 = 25 0 a 1 = 0 25/2 = 12 1 a 2 = 1 12/2 = 6 0 a 3 = 0 6/2 = 3 0 a 4 = 0 3/2 = 1 1 a 5 = 1 1/2 = 0 1 a 6 = 1^ whole number part = 1100101^2

Fraction Whole 0.593752 = 0.1875 1 a-1 = 1 0.18752 = 0.375 0 a-2 = 0 0.3752 = 0.75 0 a-3 = 0 0.752 = 0.5 1 a-4 = 1 0.5*2 = 0 1 a-5 = 1^ fraction part = 0.10011 2

Answer = 1100101.10011 2

Hexadecimal

Algorithmic Solution:

Number Remainder 101/16 = 6 5 a 0 = 5 6/16 = 0 6 a 1 = 6^ whole number part = 65 16

Fraction Whole 0.59375*16 = 0.5 9 a-1 = 9 0.5 = 0 8 a-2 = 8^ fraction part = 0.98 16

Answer = 65.98 (^16)

Binary to Hex Conversion Solution:

0110 0101. 1001 1000 2 (from above) _/ _/ _/ _/ 6 5. 9 8

Answer = 65.98 (^16)

CENG-244-M002Homework 1 1 / 5