Review of number systems
Definition
A number system is a method of representing numbers using a set of symbols, digits, and rules for combining them. In digital electronics and computer science, number systems are used to represent quantities, perform arithmetic operations, store data, and encode information efficiently. The most important number systems are decimal (base 10), binary (base 2), octal (base 8), and hexadecimal (base 16). Each system uses a different base and place-value structure, but all can represent the same numerical value.
Main Content
1. Positional Number Systems
Place value depends on position
- In a positional number system, the value of a digit depends not only on the digit itself but also on its position in the number.
Base or radix
- Every positional system has a base, which is the number of unique digits it uses. For example, decimal uses 10 digits (0–9), binary uses 2 digits (0 and 1), octal uses 8 digits (0–7), and hexadecimal uses 16 symbols (0–9 and A–F).
A positional number can be written in the form:
where is the base, and each digit’s value is multiplied by a power of the base.
For example, in decimal:
In binary:
This structure makes positional systems very efficient because a small set of symbols can represent very large values by changing position.
2. Common Number Systems
Decimal number system
- The decimal system is the everyday number system used by humans. It is base 10 and includes digits from 0 to 9. The place values increase by powers of 10.
- Example:
Binary number system
- The binary system is the fundamental number system in digital computers. It is base 2 and uses only 0 and 1. Each binary digit is called a bit.
- Example:
Octal number system
- The octal system is base 8 and uses digits 0–7. It is often used as a compact way to represent binary numbers because one octal digit corresponds to exactly three binary bits.
- Example:
Hexadecimal number system
- The hexadecimal system is base 16 and uses digits 0–9 and letters A–F, where A=10, B=11, C=12, D=13, E=14, and F=15. It is widely used in computing because it provides a compact representation of binary data.
- Example:
A compact comparison:
| System | Base | Digits/Symbols | Common Use |
|---|---|---|---|
| Decimal | 10 | 0–9 | Human arithmetic |
| Binary | 2 | 0–1 | Computers, logic circuits |
| Octal | 8 | 0–7 | Short binary representation |
| Hexadecimal | 16 | 0–9, A–F | Memory addresses, machine code, color codes |
3. Number System Conversions
Decimal to binary
- Repeated division by 2 is used for integer parts, and repeated multiplication by 2 is used for fractional parts.
- Example: Convert to binary
Reading remainders upward gives .
Binary to decimal
- Multiply each bit by its corresponding power of 2 and sum the results.
- Example:
Binary to octal and hexadecimal
- Group binary digits into sets of 3 for octal and sets of 4 for hexadecimal, starting from the right for integers.
- Example:
Octal/hexadecimal to binary
- Replace each digit with its binary equivalent.
- Example:
A simple conversion flow for integers:
Conversions are essential because computers store data in binary, but humans often prefer decimal or hexadecimal for readability.
Working / Process
1. Identify the base of the number system
Determine whether the number is decimal, binary, octal, or hexadecimal by looking at the base subscript or the allowed symbols. For example, is binary and is hexadecimal.
2. Apply place-value expansion or base conversion rules
- For conversion to decimal, expand using powers of the base.
- For decimal to another base, use repeated division for whole numbers or repeated multiplication for fractions.
- For binary-related conversions, use grouping methods:
- 3 bits per octal digit
- 4 bits per hexadecimal digit
3. Verify the result
Check the converted number by converting it back to the original system or by comparing place values. Verification reduces errors, especially in long binary and hexadecimal conversions.
Example process for converting to hexadecimal:
- Divide by 16: remainder
- Remainder 13 is
- Result:
Verification:
Advantages / Applications
Efficient data representation in computers
- Binary is ideal for electronic systems because circuits naturally have two stable states, such as ON/OFF or 1/0.
Compact human-readable coding
- Hexadecimal and octal shorten long binary strings, making debugging, memory inspection, and programming much easier.
Foundation for digital logic and arithmetic
- Number systems are essential for designing adders, subtractors, registers, counters, and other digital circuits.
Memory addressing and machine-level representation
- Hexadecimal is widely used to represent memory addresses, opcodes, and machine code in a compact form.
Error reduction in interpretation
- Converting binary data into hex or octal reduces visual complexity and helps programmers and engineers avoid mistakes.
Use in color codes and communication protocols
- Hexadecimal is used in web colors, while binary and octal concepts appear in networking, encoding, and embedded systems.
Summary
- Number systems represent numbers using a base and place value.
- Binary, octal, decimal, and hexadecimal are the most important systems in computing.
- Conversion between systems is based on powers of the base and grouping of bits.
- Important terms to remember: base (radix), digit, place value, bit, nibble, binary, octal, hexadecimal