Comprehensive Guide to Computer Number Systems: Definitions, Conversions, Examples, and Resources for Computer Instructor

Computer Number System
The computer number system is an essential concept in the field of computer science and digital electronics. It involves the representation and manipulation of numbers in different bases or radices. The most commonly used number systems in computers are Binary, Octal, Decimal, and Hexadecimal.
1. Binary Number System (Base-2)
The binary number system uses only two digits, 0 and 1. Each digit in a binary number is called a bit. Binary numbers are fundamental to computer systems because they are easy to implement using digital electronic circuitry.
Example: (1010)_2 = (1 × 2^3) + (0 × 2^2) + (1 × 2^1) + (0 × 2^0) = 8 + 0 + 2 + 0 = (10)_{10}
Binary Arithmetic
- Addition: Binary addition follows the same rules as decimal addition but is simpler due to only having two digits.
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 10 (carry 1)
- Subtraction: Binary subtraction also follows similar rules as decimal but with borrowing.
- 0 - 0 = 0
- 1 - 0 = 1
- 1 - 1 = 0
- 0 - 1 = 1 (borrow 1)
- Multiplication: Similar to decimal multiplication.
- 0 x 0 = 0
- 0 x 1 = 0
- 1 x 0 = 0
- 1 x 1 = 1
- Division: Similar to decimal division but simpler due to the binary system.
2. Octal Number System (Base-8)
The octal number system uses eight digits, from 0 to 7. It is used less frequently but can be a shorthand for binary numbers since each octal digit corresponds to three binary digits.
Example: (145)_8 = (1 × 8^2) + (4 × 8^1) + (5 × 8^0) = 64 + 32 + 5 = (101)_{10}
Octal Arithmetic
- Addition: Octal addition follows similar rules to decimal addition.
- 7 + 1 = 10 (carry 1)
- Subtraction: Octal subtraction follows similar rules to decimal subtraction.
- 10 - 1 = 7 (borrow 1)
- Multiplication and Division: Similar to binary and decimal but with base 8.
3. Decimal Number System (Base-10)
The decimal number system is the standard system for denoting integer and non-integer numbers. It uses ten digits, from 0 to 9, and is the most familiar to humans.
Example: (345)_{10} = 3 × 10^2 + 4 × 10^1 + 5 × 10^0 = 300 + 40 + 5 = 345
Decimal Arithmetic
- Addition, Subtraction, Multiplication, and Division: These are the basic arithmetic operations that everyone learns early in mathematics.
4. Hexadecimal Number System (Base-16)
The hexadecimal number system uses sixteen symbols: 0-9 and A-F, where A represents 10, B represents 11, up to F representing 15. It is widely used in computing as a more human-friendly representation of binary-coded values.
Example: (1A3)_{16} = (1 × 16^2) + (A × 16^1) + (3 × 16^0) = (1 × 256) + (10 × 16) + 3 = 256 + 160 + 3 = (419)_{10}
Hexadecimal Arithmetic
- Addition: Hexadecimal addition involves carrying over when sums exceed 15 (F).
- A + 1 = B
- F + 1 = 10 (carry 1)
- Subtraction: Hexadecimal subtraction involves borrowing.
- 10 - 1 = F (borrow 1)
- Multiplication and Division: Similar to decimal but with base 16.
Conversion Between Number Systems
Conversions between these number systems are fundamental in computer science.
Binary to Decimal Conversion
To convert a binary number to a decimal, multiply each bit by 2 raised to the power of its position index (starting from 0) and sum the results.
Example: (1101)_2 = 1 × 2^3 + 1 × 2^2 + 0 × 2^1 + 1 × 2^0 = 8 + 4 + 0 + 1 = 13
Decimal to Binary Conversion
To convert a decimal number to binary, divide the number by 2 and record the remainder. Repeat the process with the quotient until it equals 0. The binary number is the sequence of remainders read in reverse.
Example: 13_{10} → 13 ÷ 2 = 6 remainder 1 → 6 ÷ 2 = 3 remainder 0 → 3 ÷ 2 = 1 remainder 1 → 1 ÷ 2 = 0 remainder 1
(13)_{10} = (1101)_2
Octal to Binary Conversion
Each octal digit can be represented by three binary digits.
Example: (145)_8 = 001 100 101_2
Binary to Octal Conversion
Group binary digits into sets of three (starting from the right) and convert each set to its octal equivalent.
Example: (110101)_2 = (001 101 101)_2 = (155)_8
Hexadecimal to Binary Conversion
Each hexadecimal digit can be represented by four binary digits.
Example: (1A3)_{16} = 0001 1010 0011_2
Binary to Hexadecimal Conversion
Group binary digits into sets of four (starting from the right) and convert each set to its hexadecimal equivalent.
Example: (1101011)_2 = (0110 1011)_2 = (6B)_{16}
Applications of Number Systems
1. Binary System: Used in all digital computers and electronic devices.
2. Octal System: Sometimes used in computer systems as a more compact representation of binary numbers.
3. Decimal System: Used in everyday arithmetic and calculations.
4. Hexadecimal System: Used in programming and computer engineering to simplify binary notation.
Understanding these number systems is crucial for various applications in computing, including data representation, computer arithmetic, and system design.