0% found this document useful (0 votes)
10 views

assignment -1 with answer

About number systems

Uploaded by

MR. CHAVDA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

assignment -1 with answer

About number systems

Uploaded by

MR. CHAVDA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

1.

Decimal to Binary

1. Decimal 5.75 → Binary

Integer Part (5):

• 5 ÷ 2 = 2 remainder 1
• 2 ÷ 2 = 1 remainder 0
• 1 ÷ 2 = 0 remainder 1
• Binary of 5: 101

Fractional Part (0.75):

• 0.75 × 2 = 1.5 → Integer part = 1


• 0.5 × 2 = 1.0 → Integer part = 1 (stop, fractional part = 0)
• Binary of 0.75: .11

Final Binary:

• 5.75 in binary: 101.11

2. Decimal 10.625 → Binary

Integer Part (10):

• 10 ÷ 2 = 5 remainder 0
• 5 ÷ 2 = 2 remainder 1
• 2 ÷ 2 = 1 remainder 0
• 1 ÷ 2 = 0 remainder 1
• Binary of 10: 1010

Fractional Part (0.625):

• 0.625 × 2 = 1.25 → Integer part = 1


• 0.25 × 2 = 0.5 → Integer part = 0
• 0.5 × 2 = 1.0 → Integer part = 1 (stop, fractional part = 0)
• Binary of 0.625: .101

Final Binary:

• 10.625 in binary: 1010.101

3. Decimal 7.375 → Binary


Integer Part (7):

• 7 ÷ 2 = 3 remainder 1
• 3 ÷ 2 = 1 remainder 1
• 1 ÷ 2 = 0 remainder 1
• Binary of 7: 111

Fractional Part (0.375):

• 0.375 × 2 = 0.75 → Integer part = 0


• 0.75 × 2 = 1.5 → Integer part = 1
• 0.5 × 2 = 1.0 → Integer part = 1 (stop, fractional part = 0)
• Binary of 0.375: .011

Final Binary:

• 7.375 in binary: 111.011

4. Decimal 3.5 → Binary

Integer Part (3):

• 3 ÷ 2 = 1 remainder 1
• 1 ÷ 2 = 0 remainder 1
• Binary of 3: 11

Fractional Part (0.5):

• 0.5 × 2 = 1.0 → Integer part = 1 (stop, fractional part = 0)


• Binary of 0.5: .1

Final Binary:

• 3.5 in binary: 11.1

5. Decimal 12.875 → Binary

Integer Part (12):

• 12 ÷ 2 = 6 remainder 0
• 6 ÷ 2 = 3 remainder 0
• 3 ÷ 2 = 1 remainder 1
• 1 ÷ 2 = 0 remainder 1
• Binary of 12: 1100
Fractional Part (0.875):

• 0.875 × 2 = 1.75 → Integer part = 1


• 0.75 × 2 = 1.5 → Integer part = 1
• 0.5 × 2 = 1.0 → Integer part = 1 (stop, fractional part = 0)
• Binary of 0.875: .111

Final Binary:

• 12.875 in binary: 1100.111

6. Decimal 10 → Binary

• Step 1: 10 ÷ 2 = 5 remainder 0
• Step 2: 5 ÷ 2 = 2 remainder 1
• Step 3: 2 ÷ 2 = 1 remainder 0
• Step 4: 1 ÷ 2 = 0 remainder 1
• Binary: 1010

7. Decimal 45 → Binary

• Step 1: 45 ÷ 2 = 22 remainder 1
• Step 2: 22 ÷ 2 = 11 remainder 0
• Step 3: 11 ÷ 2 = 5 remainder 1
• Step 4: 5 ÷ 2 = 2 remainder 1
• Step 5: 2 ÷ 2 = 1 remainder 0
• Step 6: 1 ÷ 2 = 0 remainder 1
• Binary: 101101

8. Decimal 255 → Binary

• Step 1: 255 ÷ 2 = 127 remainder 1


• Step 2: 127 ÷ 2 = 63 remainder 1
• Step 3: 63 ÷ 2 = 31 remainder 1
• Step 4: 31 ÷ 2 = 15 remainder 1
• Step 5: 15 ÷ 2 = 7 remainder 1
• Step 6: 7 ÷ 2 = 3 remainder 1
• Step 7: 3 ÷ 2 = 1 remainder 1
• Step 8: 1 ÷ 2 = 0 remainder 1
• Binary: 11111111

9. Decimal 100 → Binary

• Step 1: 100 ÷ 2 = 50 remainder 0


• Step 2: 50 ÷ 2 = 25 remainder 0
• Step 3: 25 ÷ 2 = 12 remainder 1
• Step 4: 12 ÷ 2 = 6 remainder 0
• Step 5: 6 ÷ 2 = 3 remainder 0
• Step 6: 3 ÷ 2 = 1 remainder 1
• Step 7: 1 ÷ 2 = 0 remainder 1
• Binary: 1100100

10. Decimal 128 → Binary

• Step 1: 128 ÷ 2 = 64 remainder 0


• Step 2: 64 ÷ 2 = 32 remainder 0
• Step 3: 32 ÷ 2 = 16 remainder 0
• Step 4: 16 ÷ 2 = 8 remainder 0
• Step 5: 8 ÷ 2 = 4 remainder 0
• Step 6: 4 ÷ 2 = 2 remainder 0
• Step 7: 2 ÷ 2 = 1 remainder 0
• Step 8: 1 ÷ 2 = 0 remainder 1
• Binary: 10000000

2.Decimal to Octal
1. Decimal 23.375 → Octal

Integer Part (23):

• 23 ÷ 8 = 2 remainder 7
• 2 ÷ 8 = 0 remainder 2
• Octal of 23: 27

Fractional Part (0.375):

• 0.375 × 8 = 3.0 → Integer part = 3 (stop, fractional part = 0)


• Octal of 0.375: .3

Final Octal:

• 23.375 in octal: 27.3

2. Decimal 10.625 → Octal

Integer Part (10):

• 10 ÷ 8 = 1 remainder 2
• 1 ÷ 8 = 0 remainder 1
• Octal of 10: 12

Fractional Part (0.625):


• 0.625 × 8 = 5.0 → Integer part = 5 (stop, fractional part = 0)
• Octal of 0.625: .5

Final Octal:

• 10.625 in octal: 12.5

3. Decimal 7.125 → Octal

Integer Part (7):

• 7 ÷ 8 = 0 remainder 7
• Octal of 7: 7

Fractional Part (0.125):

• 0.125 × 8 = 1.0 → Integer part = 1 (stop, fractional part = 0)


• Octal of 0.125: .1

Final Octal:

• 7.125 in octal: 7.1

4. Decimal 5.375 → Octal

Integer Part (5):

• 5 ÷ 8 = 0 remainder 5
• Octal of 5: 5

Fractional Part (0.375):

• 0.375 × 8 = 3.0 → Integer part = 3 (stop, fractional part = 0)


• Octal of 0.375: .3

Final Octal:

• 5.375 in octal: 5.3

5. Decimal 2.75 → Octal

Integer Part (2):


• 2 ÷ 8 = 0 remainder 2
• Octal of 2: 2

Fractional Part (0.75):

• 0.75 × 8 = 6.0 → Integer part = 6 (stop, fractional part = 0)


• Octal of 0.75: .6

Final Octal:

• 2.75 in octal: 2.6

Decimal to Octal Conversion (Whole Numbers)

1. Decimal 64 → Octal

• 64 ÷ 8 = 8 remainder 0

• 8 ÷ 8 = 1 remainder 0

• 1 ÷ 8 = 0 remainder 1

• Octal of 64: 100

2. Decimal 125 → Octal

• 125 ÷ 8 = 15 remainder 5

• 15 ÷ 8 = 1 remainder 7

• 1 ÷ 8 = 0 remainder 1

• Octal of 125: 175

3. Decimal 200 → Octal

• 200 ÷ 8 = 25 remainder 0

• 25 ÷ 8 = 3 remainder 1

• 3 ÷ 8 = 0 remainder 3

• Octal of 200: 310

4. Decimal 512 → Octal

• 512 ÷ 8 = 64 remainder 0

• 64 ÷ 8 = 8 remainder 0
• 8 ÷ 8 = 1 remainder 0

• 1 ÷ 8 = 0 remainder 1

• Octal of 512: 1000

5. Decimal 77 → Octal

• 77 ÷ 8 = 9 remainder 5

• 9 ÷ 8 = 1 remainder 1

• 1 ÷ 8 = 0 remainder 1

• Octal of 77: 115

3.Decimal to Hexadecimal

1. Decimal 123 → Hexadecimal

• 123 ÷ 16 = 7 remainder 11 → Hex digit for 11 = B

• 7 ÷ 16 = 0 remainder 7

• Hexadecimal of 123: 7B

2. Decimal 255 → Hexadecimal

• 255 ÷ 16 = 15 remainder 15 → Hex digit for 15 = F

• 15 ÷ 16 = 0 remainder 15 → Hex digit for 15 = F

• Hexadecimal of 255: FF

3. Decimal 512 → Hexadecimal

• 512 ÷ 16 = 32 remainder 0

• 32 ÷ 16 = 2 remainder 0

• 2 ÷ 16 = 0 remainder 2

• Hexadecimal of 512: 200

4. Decimal 1000 → Hexadecimal

• 1000 ÷ 16 = 62 remainder 8
• 62 ÷ 16 = 3 remainder 14 → Hex digit for 14 = E

• 3 ÷ 16 = 0 remainder 3

• Hexadecimal of 1000: 3E8

5. Decimal 4096 → Hexadecimal

• 4096 ÷ 16 = 256 remainder 0

• 256 ÷ 16 = 16 remainder 0

• 16 ÷ 16 = 1 remainder 0

• 1 ÷ 16 = 0 remainder 1

• Hexadecimal of 4096: 1000

3. Decimal 7896.53125 → Hexadecimal

Integer Part (7896):

• 7896 ÷ 16 = 493 remainder 8

• 493 ÷ 16 = 30 remainder 13 → Hex digit for 13 = D

• 30 ÷ 16 = 1 remainder 14 → Hex digit for 14 = E

• 1 ÷ 16 = 0 remainder 1

• Hexadecimal of 7896: 1ED8

Fractional Part (0.53125):

• 0.53125 × 16 = 8.5 → Integer part = 8

• 0.5 × 16 = 8.0 → Integer part = 8

• Hexadecimal of 0.53125: .88

Final Hexadecimal:

• 7896.53125 in hexadecimal: 1ED8.88

4. Decimal 15732.8125 → Hexadecimal

Integer Part (15732):

• 15732 ÷ 16 = 983 remainder 4

• 983 ÷ 16 = 61 remainder 7

• 61 ÷ 16 = 3 remainder 13 → Hex digit for 13 = D

• 3 ÷ 16 = 0 remainder 3
• Hexadecimal of 15732: 3D74

Fractional Part (0.8125):

• 0.8125 × 16 = 13.0 → Integer part = 13 → Hex digit for 13 = D

• Hexadecimal of 0.8125: .D

Final Hexadecimal:

• 15732.8125 in hexadecimal: 3D74.D

5. Decimal 512.6875 → Hexadecimal

Integer Part (512):

• 512 ÷ 16 = 32 remainder 0

• 32 ÷ 16 = 2 remainder 0

• 2 ÷ 16 = 0 remainder 2

• Hexadecimal of 512: 200

Fractional Part (0.6875):

• 0.6875 × 16 = 11.0 → Integer part = 11 → Hex digit for 11 = B

• Hexadecimal of 0.6875: .B

Final Hexadecimal:

• 512.6875 in hexadecimal: 200.B

4.Hexadecimal to Decimal
Hexadecimal to Decimal (Normal Integer Examples)
5.octal to decimal
6.Binary to Decimal
7.convert octal to hexadecimal
8.convert hexadecimal to octal

You might also like