Unit 2
Unit 2
Number Systems: Binary, Octal and Hexadecimal number systems, Binary Coded Decimals
(BCD), Binary Coded Octals (BCO), Binary Coded Hexadecimals (BCH), 1's complement, 2's
complement, conversion from one number system to another, binary arithmetic (addition,
A **number system** is a way of representing numbers using a consistent set of symbols and
rules. In computing, different number systems are used to represent and process data
efficiently. The most common number systems are **binary, octal, and hexadecimal**, which
are extensively used in digital electronics and computer science.
---
|--------------|------|------------|---------|
Each number system has a **base**, which determines the number of unique digits used.
---
- The **least significant bit (LSB)** is the rightmost bit, and the **most significant bit (MSB)**
is the leftmost bit.
- **Widely used in digital electronics and computing** since computers use electrical signals
(ON = 1, OFF = 0).
\[
13_{10} = 1 \times 2^3 + 1 \times 2^2 + 0 \times 2^1 + 1 \times 2^0 = 1101_2
\]
---
- Convenient in computing because **three binary digits** form one octal digit.
- Group the binary digits into **groups of three** (from right to left).
- Convert each group to its octal equivalent.
- **101₂ = 5₈**
- **101₂ = 5₈**
---
- Uses **16 digits: 0-9 and A-F** (A = 10, B = 11, ..., F = 15).
- Group the binary digits into **groups of four** from right to left.
- **1101₂ = D₁₆**
- **1101₂ = D₁₆**
---
## **5. Binary Coded Decimal (BCD), Binary Coded Octal (BCO), and Binary Coded
Hexadecimal (BCH)**
- Example:
- **27₁₀** in BCD:
- **2 = 0010₂**
- **7 = 0111₂**
- Example:
- **75₈** in binary:
- **7 = 111₂**
- **5 = 101₂**
- Example:
- **A3₁₆** in binary:
- **A = 1010₂**
- **3 = 0011₂**
---
Complements are used in digital circuits for **subtraction and error detection**.
Example:
Example:
---
Divide the decimal number by **2**, recording the remainder each time.
\[
19 ÷ 2 = 9 \text{ remainder } 1
9 ÷ 2 = 4 \text{ remainder } 1
4 ÷ 2 = 2 \text{ remainder } 0
2 ÷ 2 = 1 \text{ remainder } 0
1 ÷ 2 = 0 \text{ remainder } 1
\]
---
|----------------|--------|
|0+0 |0 |
|0+1 |1 |
|1+0 |1 |
|1+1 | 10 (carry 1) |
Example:
\[
1011_2 + 1101_2 =
\]
```
1011
+ 1101
---------
11000
```
Answer: **11000₂**.
- Add 1: **0111₂**
```
1101
+ 0111
---------
```
---
## **Conclusion**
Number systems are fundamental to digital computing. The **binary system** forms the core
of computer operations, while **octal and hexadecimal** simplify binary representation.
Understanding **complements and binary arithmetic** is crucial for working with digital
circuits, microprocessors, and low-level programming.