1/2  → 0  Remainder 1 (MSD)

The binary number is 111002.

Example 1.4

Convert decimal number 6510 into binary.

Solution 1.4

Divide the number into 2 repeatedly and take the remainders:

65/2 → 32 Remainder 1 (LSD)

32/2 → 16 Remainder 0

16/2 → 8  Remainder 0

8/2  → 4  Remainder 0

4/2  → 2  Remainder 0

2/2  → 1  Remainder 0

1/2  → 0  Remainder 1 (MSD)

The binary number is 10000012.

Example 1.5

Convert decimal number 12210 into binary.

Solution 1.5

Divide the number into 2 repeatedly and take the remainders:

122/2 → 61 Remainder 0 (LSD)

61/2  → 30 Remainder 1

30/2  → 15 Remainder 0

15/2  → 7  Remainder 1

7/2   → 3  Remainder 1

3/2   → 1  Remainder 1

1/2   → 0  Remainder 1 (MSD)

The binary number is 11110102.

1.8 Converting Binary Numbers into Hexadecimal

To convert a binary number into hexadecimal, arrange the number in groups of four and find the hexadecimal equivalent of each group. If the number cannot be divided exactly into groups of four, insert zeros to the left of the number as needed so the number of digits are divisible by four.

Example 1.6

Convert binary number 100111112 into hexadecimal.

Solution 1.6

First, divide the number into groups of four, then find the hexadecimal equivalent of each group:

10011111 = 1001 1111

             9    F

The hexadecimal number is 9F16.



22 из 499