Introduction to Number Systems
A number system is a mathematical notation for representing numbers using digits or symbols in a consistent manner. Different number systems use distinct rules to express values, and the same sequence of symbols can represent different numbers depending on the system. Number systems are broadly classified into two types:
- Non-Positional Number Systems: Use symbols where the position does not affect the value.
- Positional Number Systems: Use digits where the value depends on both the digit and its position.
This chapter explores these systems, their characteristics, and methods for converting between them, with a focus on their relevance to computing.
Non-Positional Number Systems
Characteristics
- Use symbols like I for 1, II for 2, III for 3, IIII for 4, IIIII for 5, etc.
- Each symbol represents the same value regardless of its position.
- The value of a number is determined by adding the symbols.
Difficulties
- Arithmetic operations (e.g., addition, multiplication) are cumbersome.
- Large numbers require many symbols, making them impractical for complex calculations.
Positional Number Systems
In positional number systems, the value of a digit depends on:
- The digit itself.
- Its position in the number.
- The base of the number system (the total number of digits available).
The maximum value of a single digit is always one less than the base (e.g., 9 for base 10, 1 for base 2).
Characteristics
- Use a limited set of symbols called digits.
- Digits represent different values based on their position.
Decimal Number System
Characteristics
- Positional system with 10 digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9); base = 10.
- Maximum digit value is 9 (base - 1).
- Each position represents a power of 10 (e.g., units, tens, hundreds).
- Widely used in everyday life.
Example
258610 = (2 × 10³) + (5 × 10²) + (8 × 10¹) + (6 × 10⁰)
= 2000 + 500 + 80 + 6 = 258610
Binary Number System
Characteristics
- Positional system with 2 digits (0, 1); base = 2.
- Maximum digit value is 1 (base - 1).
- Each position represents a power of 2.
- Fundamental to computers, representing on/off states.
Example
101012 = (1 × 2⁴) + (0 × 2³) + (1 × 2²) + (0 × 2¹) + (1 × 2⁰)
= 16 + 0 + 4 + 0 + 1 = 2110
Bit (Binary Digit)
A bit is a single binary digit (0 or 1). An n-bit number consists of n binary digits. Bits are the smallest unit of data in computing.
Octal Number System
Characteristics
- Positional system with 8 digits (0, 1, 2, 3, 4, 5, 6, 7); base = 8.
- Maximum digit value is 7 (base - 1).
- Each position represents a power of 8.
- Three bits (2³ = 8) represent one octal digit in binary.
Example
20578 = (2 × 8³) + (0 × 8²) + (5 × 8¹) + (7 × 8⁰)
= 1024 + 0 + 40 + 7 = 107110
Hexadecimal Number System
Characteristics
- Positional system with 16 digits (0–9, A–F); base = 16.
- Letters A, B, C, D, E, F represent decimal values 10, 11, 12, 13, 14, 15.
- Maximum digit value is 15 (base - 1).
- Each position represents a power of 16.
- Four bits (2⁴ = 16) represent one hexadecimal digit in binary.
Example
1AF16 = (1 × 16²) + (A × 16¹) + (F × 16⁰)
= 256 + (10 × 16) + 15 = 256 + 160 + 15 = 43110
Converting Between Number Bases
Another Base to Decimal Base
- Determine the positional value of each digit (power of the base).
- Multiply each digit by its positional value.
- Sum the products.
Example
47068 = (4 × 8³) + (7 × 8²) + (0 × 8¹) + (6 × 8⁰)
= 2048 + 448 + 0 + 6 = 250210
Decimal Base to Another Base (Division-Remainder Method)
- Divide the decimal number by the new base.
- Record the remainder as the least significant digit.
- Divide the quotient by the new base, recording the remainder as the next digit.
- Repeat until the quotient is zero; the last remainder is the most significant digit.
Example
95210 to base 8:
Division | Quotient | Remainder |
---|---|---|
952 ÷ 8 | 119 | 0 |
119 ÷ 8 | 14 | 7 |
14 ÷ 8 | 1 | 6 |
1 ÷ 8 | 0 | 1 |
Result: 95210 = 16708
Some Base to Another Base
- Convert the original number to decimal (base 10).
- Convert the decimal number to the new base.
Example
5456 to base 4:
Step 1: 5456 = (5 × 6²) + (4 × 6¹) + (5 × 6⁰) = 180 + 24 + 5 = 20910
Step 2: Convert 20910 to base 4:
Division | Quotient | Remainder |
---|---|---|
209 ÷ 4 | 52 | 1 |
52 ÷ 4 | 13 | 0 |
13 ÷ 4 | 3 | 1 |
3 ÷ 4 | 0 | 3 |
Result: 20910 = 31014, so 5456 = 31014
Shortcut Methods
Binary to Octal
- Group binary digits into sets of three, starting from the right.
- Convert each group to an octal digit.
Example
11010102 = 001|101|010 → 18|58|28 = 1528
Octal to Binary
- Convert each octal digit to a 3-bit binary number.
- Combine the binary groups.
Example
5628 = 5→101, 6→110, 2→010 = 1011100102
Binary to Hexadecimal
- Group binary digits into sets of four, starting from the right.
- Convert each group to a hexadecimal digit.
Example
1111012 = 0011|1101 → 316|D16 = 3D16
Hexadecimal to Binary
- Convert each hexadecimal digit to a 4-bit binary number.
- Combine the binary groups.
Example
2AB16 = 2→0010, A→1010, B→1011 = 0010101010112
Fractional Numbers
Fractional numbers in any base follow the same positional principles as whole numbers, with digits to the right of the point representing negative powers of the base.
General form: anan-1...a0.a-1a-2...a-m
Value: an × bn + ... + a0 × b0 + a-1 × b-1 + ... + a-m × b-m
Binary Fractional Numbers
Example: 110.1012 = (1 × 2²) + (1 × 2¹) + (0 × 2⁰) + (1 × 2⁻¹) + (0 × 2⁻²) + (1 × 2⁻³)
= 4 + 2 + 0 + 0.5 + 0 + 0.125 = 6.62510
Octal Fractional Numbers
Example: 127.548 = (1 × 8²) + (2 × 8¹) + (7 × 8⁰) + (5 × 8⁻¹) + (4 × 8⁻²)
= 64 + 16 + 7 + 0.625 + 0.0625 = 87.687510
Applications of Number Systems in Computing
Number systems are fundamental to computing:
- Binary: Used in digital circuits, memory, and processor operations, as computers operate on 0s and 1s.
- Octal: Simplifies binary representation in early computers and Unix file permissions.
- Hexadecimal: Used in memory dumps, color codes (e.g., #FFFFFF), and programming for compact binary representation.
- ASCII Code: A character encoding standard using 7 or 8 bits to represent text (e.g., 'A' = 6510 = 4116), enabling computers to process and display text.
Understanding number systems and conversions is crucial for programming, debugging, and hardware design.
Questions
- What is a number system?
- How many types of number systems are there?
- What is a non-positional number system?
- What are the characteristics of a non-positional number system?
- What are the difficulties of a non-positional number system?
- What is a positional number system?
- What are the characteristics of a positional number system?
- What are the difficulties of a positional number system?
- How many types of representations of number systems are there?
- What is the decimal number system?
- What is the binary number system?
- What is the octal number system?
- What is the hexadecimal number system?
- What is ASCII code?
- What is a BIT?
- What is the full form of BIT?
- What is a binary digit?
- What are the characteristics of a binary digit?
- How do you convert a number's base?
- How do you convert another number base into decimal base?
- How do you convert a decimal number base into another base?
- How do you convert from one base to another base?
- How do you convert a binary number to its equivalent octal number?
- How do you convert an octal number to its equivalent binary number?
- How do you convert a binary number to a hexadecimal number?
- How do you convert a hexadecimal number to its equivalent binary number?
- What are fractional numbers?
- What is the formation of fractional numbers in the binary number system?