1. Number Systems (Digital Electronics)
1.1 Introduction
A number system is a method of representing numerical values using a specific set of symbols and rules. In everyday life, humans use the decimal number system (base 10). However, digital computers and electronic circuits operate using the binary number system (base 2).
This is because electronic components such as transistors have only two stable states: ON and OFF, which are naturally represented as 1 and 0. All data inside a digital system—numbers, text, images, audio, and instructions—are ultimately represented in binary form.
1.2 Types of Number Systems
(a) Decimal Number System (Base 10)
The decimal number system is the most commonly used number system in daily life.
- Base: 10
- Digits: 0 to 9
- Positional weights: Powers of 10
Example:
(345)₁₀ = 3 × 10² + 4 × 10¹ + 5 × 10⁰
= 300 + 40 + 5
= 345
Example Problem 1
Expand the decimal number (709)₁₀ using positional weights.
(709)₁₀ = 7 × 10² + 0 × 10¹ + 9 × 10⁰
= 700 + 0 + 9
= 709
(b) Binary Number System (Base 2)
The binary number system is the foundation of all digital systems.
- Base: 2
- Digits: 0 and 1
- Positional weights: Powers of 2
Example:
(1011)₂ = 1 × 2³ + 0 × 2² + 1 × 2¹ + 1 × 2⁰
= 8 + 0 + 2 + 1
= 11₁₀
Example Problem 2
Convert the binary number (11010)₂ into decimal.
(11010)₂ = 1×2⁴ + 1×2³ + 0×2² + 1×2¹ + 0×2⁰
= 16 + 8 + 0 + 2 + 0
= 26₁₀
(c) Octal Number System (Base 8)
The octal number system provides a compact representation of binary numbers.
- Base: 8
- Digits: 0 to 7
Each octal digit corresponds to three binary bits.
Example
Binary: 110 101 011 Octal : 6 5 3 (110101011)₂ = (653)₈
(d) Hexadecimal Number System (Base 16)
The hexadecimal number system is widely used in computer systems to represent large binary values in a readable form.
- Base: 16
- Digits: 0–9 and A–F
- A = 10, B = 11, C = 12, D = 13, E = 14, F = 15
Each hexadecimal digit represents four binary bits.
Example
Binary : 1010 1111 Hexadecimal : A F (10101111)₂ = (AF)₁₆
1.3 Number System Conversions
Decimal to Binary
To convert a decimal number to binary, repeatedly divide the number by 2 and record the remainders.
Example Problem 3
Convert (25)₁₀ to binary.
25 ÷ 2 = 12 remainder 1 12 ÷ 2 = 6 remainder 0 6 ÷ 2 = 3 remainder 0 3 ÷ 2 = 1 remainder 1 1 ÷ 2 = 0 remainder 1 (25)₁₀ = (11001)₂
Binary to Octal / Hexadecimal
For binary to octal conversion, group bits in sets of three. For binary to hexadecimal conversion, group bits in sets of four.
1.4 Binary Arithmetic
Binary Addition
0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 10 (sum = 0, carry = 1)
Example Problem 4
1011 + 0110 ------ 10001
Binary Subtraction
0 - 0 = 0 1 - 0 = 1 1 - 1 = 0 10 - 1 = 1 (borrow)
1’s Complement
The 1’s complement of a binary number is obtained by inverting all bits.
Binary number : 101001 1’s Complement : 010110
2’s Complement
The 2’s complement is obtained by adding 1 to the 1’s complement. It is widely used to represent negative numbers in digital systems.
Binary number : 101001 1’s Complement : 010110 2’s Complement : 010111
1.5 Codes
Binary Coded Decimal (BCD)
In BCD, each decimal digit is represented using a 4-bit binary number.
Decimal 7 → 0111 Decimal 9 → 1001 Decimal 45 → 0100 0101
Gray Code
Gray code is a binary code in which two successive values differ by only one bit. This property minimizes errors in digital systems such as rotary encoders.
Binary : 000 001 010 011 100 Gray : 000 001 011 010 110
ASCII Code
ASCII (American Standard Code for Information Interchange) is used to represent characters in digital systems.
'A' → 65 → 01000001 'a' → 97 → 01100001 '0' → 48 → 00110000
ASCII allows computers to store and process text, numbers, and symbols efficiently.