9.2 Positional Number Systems

COS2621 - Computer Organisation · 9. Number Systems

9.2 Positional Number Systems

Understanding Positional Number Systems

A positional number system represents numbers using a base and a set of digits. The value of a digit depends on its position in the number. The most common positional systems are decimal (base 10), binary (base 2), and hexadecimal (base 16).

Decimal System

In the decimal system, each digit's position represents a power of 10. For example, in the number 345:

  • 3 is in the hundreds place (3 × 10² = 300)
  • 4 is in the tens place (4 × 10¹ = 40)
  • 5 is in the units place (5 × 10⁰ = 5)

Thus, 345 = 300 + 40 + 5.

Binary System

The binary system uses only two digits: 0 and 1. Each position represents a power of 2. For example, the binary number 1011 is calculated as follows:

  • 1 in the 2³ place (1 × 8 = 8)
  • 0 in the 2² place (0 × 4 = 0)
  • 1 in the 2¹ place (1 × 2 = 2)
  • 1 in the 2⁰ place (1 × 1 = 1)

Thus, 10112 = 8 + 0 + 2 + 1 = 1110.

Hexadecimal Notation

Hexadecimal is a base 16 system that uses digits 0-9 and letters A-F. For example, the hexadecimal number 2F3:

  • 2 is in the 16² place (2 × 256 = 512)
  • F (15 in decimal) is in the 16¹ place (15 × 16 = 240)
  • 3 is in the 16⁰ place (3 × 1 = 3)

Thus, 2F316 = 512 + 240 + 3 = 75510.

Converting Between Number Systems

To convert from decimal to binary, repeatedly divide the number by 2 and record the remainders. For example, converting 45 to binary:

45 ÷ 2 = 22 remainder 1
22 ÷ 2 = 11 remainder 0
11 ÷ 2 = 5 remainder 1
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1

Reading the remainders from bottom to top gives 1011012.

Watch out: When converting numbers, ensure you correctly identify the base and apply the correct powers for each digit.

Importance of Positional Number Systems

Positional number systems are essential in computing as they allow for efficient representation and manipulation of data. Different bases are used depending on the context: binary for low-level operations, decimal for human interaction, and hexadecimal for compact representation of binary data.

Summary

  • Positional number systems assign values based on digit position.
  • Decimal uses base 10, binary uses base 2, and hexadecimal uses base 16.
  • Conversions between these systems can be performed using division or multiplication methods.

Check your understanding

  • What is the value of the binary number 1100 in decimal?
  • Convert the decimal number 58 to binary.
  • What is the hexadecimal representation of the decimal number 255?
  • Explain why positional number systems are important in computing.

Test yourself

5 quick questions on this lesson. Pick an answer to see if you're right.

  1. 1. What is the binary equivalent of the decimal number 25?

  2. 2. What shortcomings of ASCII led to the development of Unicode?

  3. 3. What is the decimal equivalent of the binary number 1101?

  4. 4. In a positional number system, the value of a digit is determined by its:

  5. 5. Which of the following is the hexadecimal representation of the decimal number 255?