Introduction to Number Systems: Binary, Decimal, Octal and Hexadecimal Explained

Introduction to Number Systems: Binary, Decimal, Octal and Hexadecimal Explained

Introduction to Number Systems: Binary, Decimal, Octal and Hexadecimal Explained

Search Description: Learn number systems in simple words including decimal, binary, octal, hexadecimal, radix, place value, bits, bytes, complements and conversion examples.

Main Keywords: number system, binary number system, decimal number system, octal number system, hexadecimal number system, radix, base, bits and bytes, 1's complement, 2's complement, computer number system.

Number systems are the basic language of mathematics, digital electronics and computers. We use the decimal number system in daily life, but computers mainly work with binary numbers. To make binary numbers shorter and easier to read, octal and hexadecimal number systems are also used.

For beginners, number systems may look confusing at first because the same digits can have different meanings in different bases. For example, 10 in decimal means ten, but 10 in binary means two. This happens because every number system has its own base or radix.

What is a Number System?

A number system is a method of representing numbers using a fixed set of symbols or digits. Every number system has three important properties:

  • Base or radix: Number of unique digits used in the system.
  • Place value: Value of a digit depending on its position.
  • Maximum numbers: Number of values that can be represented using a fixed number of digits.

The base or radix is the most important part of any number system. Decimal has base 10, binary has base 2, octal has base 8, and hexadecimal has base 16.

For any number system:
Place values = r0, r1, r2, r3 ... for integer part
Place values = r-1, r-2, r-3 ... for fractional part
where r = radix or base

Types of Number Systems

Number System Base Digits Used Common Use
Decimal 10 0 to 9 Daily calculations and human counting
Binary 2 0 and 1 Computers, digital circuits, microprocessors
Octal 8 0 to 7 Compact representation of binary numbers
Hexadecimal 16 0 to 9 and A to F Memory addresses, programming and digital electronics

Decimal Number System

The decimal number system is the most familiar number system. It has a radix of 10 and uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. After 9, numbers are formed by using combinations of these digits, such as 10, 11, 12 and so on.

The place values in decimal are powers of 10. Starting from the decimal point, the integer side has place values 100, 101, 102, 103 and so on. The fractional side has 10-1, 10-2, 10-3 and so on.

Example: Decimal Expansion

3586 = 6 × 100 + 8 × 101 + 5 × 102 + 3 × 103
3586 = 6 + 80 + 500 + 3000

Similarly, the fractional part 0.265 can be written as:

0.265 = 2 × 10-1 + 6 × 10-2 + 5 × 10-3

Binary Number System

The binary number system is a base-2 number system. It uses only two digits: 0 and 1. These two digits are called binary digits or bits. Since computers and digital circuits work with two voltage levels, binary numbers are the natural language of computers.

In digital electronics, 0 usually represents OFF, LOW or false, while 1 represents ON, HIGH or true.

First Few Binary Numbers

DecimalBinary
00
11
210
311
4100
5101
6110
7111
81000

Binary Place Values

The place values in binary are powers of 2:

20, 21, 22, 23, 24 ...
1, 2, 4, 8, 16 ...

Example: Binary to Decimal

(1011)2 = 1×23 + 0×22 + 1×21 + 1×20
= 8 + 0 + 2 + 1 = (11)10

Octal Number System

The octal number system has a base of 8. It uses eight digits: 0, 1, 2, 3, 4, 5, 6 and 7. Digits 8 and 9 are not used in octal numbers.

Octal was commonly used in older computer systems because it provides a shorter way to write binary numbers. One octal digit represents three binary bits.

Octal Place Values

80, 81, 82, 83 ...
1, 8, 64, 512 ...

Example: Octal to Decimal

(157)8 = 1×82 + 5×81 + 7×80
= 64 + 40 + 7 = (111)10

Hexadecimal Number System

The hexadecimal number system has a base of 16. It uses sixteen symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F.

Hex DigitDecimal Value
A10
B11
C12
D13
E14
F15

Hexadecimal is very important in computer science and microprocessors because it gives a compact form of binary numbers. One hexadecimal digit represents four binary bits.

Example: Hexadecimal to Decimal

(2A)16 = 2×161 + A×160
= 2×16 + 10×1 = 42

Why Hexadecimal is Used in Computers

Binary numbers become very long when memory addresses or machine instructions are written directly. Hexadecimal makes them shorter and easier to understand.

For example, a 16-bit address can range from:

Binary: 00000000 00000000 to 11111111 11111111
Hexadecimal: 0000 to FFFF

This is why memory addresses, machine codes, color codes in web design, and microprocessor instructions are commonly represented in hexadecimal form.

Common Terms in Number Systems

Term Meaning
Bit Smallest unit of digital information; it can be 0 or 1.
Nibble Group of 4 bits.
Byte Group of 8 bits.
Word Group of bits processed by a computer at one time.
Radix/Base Number of unique digits used in a number system.
MSB Most Significant Bit, the leftmost bit in a binary number.
LSB Least Significant Bit, the rightmost bit in a binary number.

Number System Conversions

Decimal to Binary Conversion

To convert decimal to binary, divide the decimal number by 2 repeatedly and note the remainders. Then read the remainders from bottom to top.

Convert (13)10 to binary:
13 ÷ 2 = 6 remainder 1
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Answer = (1101)2

Binary to Octal Conversion

For binary to octal conversion, group binary digits in sets of three from the right side.

(110101)2 = 110 101
110 = 6, 101 = 5
Answer = (65)8

Binary to Hexadecimal Conversion

For binary to hexadecimal conversion, group binary digits in sets of four from the right side.

(10101100)2 = 1010 1100
1010 = A, 1100 = C
Answer = (AC)16

Complements in Number Systems

Complements are used in digital systems to perform subtraction and represent negative numbers. They are very important in computer arithmetic.

1's Complement and 2's Complement

The 1's complement of a binary number is obtained by changing every 0 into 1 and every 1 into 0. The 2's complement is obtained by adding 1 to the 1's complement.

Binary number = 10010110
1's complement = 01101001
2's complement = 01101010

9's and 10's Complement

In the decimal number system, 9's complement is obtained by subtracting each digit from 9. The 10's complement is obtained by adding 1 to the 9's complement.

Number = 2496
9's complement = 7503
10's complement = 7504

7's and 8's Complement

In the octal number system, 7's complement is obtained by subtracting each digit from 7. The 8's complement is obtained by adding 1.

Octal number = 562
7's complement = 215
8's complement = 216

15's and 16's Complement

In hexadecimal, 15's complement is obtained by subtracting each digit from F. The 16's complement is obtained by adding 1.

Hex number = 3BF
15's complement = C40

Real-Life Applications of Number Systems

  • Binary: Used in computers, microprocessors, digital circuits and logic gates.
  • Decimal: Used in everyday counting, money, measurement and calculations.
  • Octal: Used in compact binary representation and some older computing systems.
  • Hexadecimal: Used in memory addressing, machine code, web color codes and embedded systems.

Common Mistakes Beginners Should Avoid

  • Writing 8 or 9 in an octal number.
  • Forgetting that A to F are valid hexadecimal digits.
  • Reading binary 10 as decimal ten instead of decimal two.
  • Not grouping binary digits correctly during octal or hexadecimal conversion.
  • Confusing 1's complement with 2's complement.

Quick Revision Table

Concept Important Point
Decimal Base 10, uses 0 to 9.
Binary Base 2, uses 0 and 1.
Octal Base 8, uses 0 to 7.
Hexadecimal Base 16, uses 0 to 9 and A to F.
Bit One binary digit.
Byte 8 bits.
Nibble 4 bits.
2's Complement Used to represent negative binary numbers.

Frequently Asked Questions

What is a number system?

A number system is a method of representing numbers using a fixed set of digits and rules.

What is radix or base?

Radix or base is the number of unique symbols used in a number system. For example, binary has base 2 and decimal has base 10.

Why do computers use binary numbers?

Computers use binary numbers because digital circuits can easily represent two states: ON and OFF, or 1 and 0.

Why is hexadecimal used in programming?

Hexadecimal is used because it represents long binary values in a shorter and more readable form.

What is the difference between bit and byte?

A bit is a single binary digit, while a byte is a group of 8 bits.

What is 2's complement used for?

2's complement is mainly used to represent negative numbers and perform subtraction in digital computers.

Conclusion

Number systems are the foundation of digital electronics, computers and microprocessors. Decimal numbers are used in daily life, while binary numbers are used inside computers. Octal and hexadecimal systems make binary numbers shorter and easier to write. Understanding radix, place value, bits, bytes and complements helps students build a strong base in digital electronics and computer organization.

Final Takeaway: If you understand binary, decimal, octal and hexadecimal number systems clearly, topics like logic gates, microprocessors, memory addressing and computer architecture become much easier to learn.

No comments