Number System - BCA 1st Year Notes
Number System and Conversions
1. What is Number System?
It is a way to represent numbers using different bases.
2. Types of Number Systems:
- Decimal (Base 10): Digits 0-9
- Binary (Base 2): Digits 0, 1
- Octal (Base 8): Digits 0-7
- Hexadecimal (Base 16): Digits 0-9, A-F
3. Conversions:
Decimal to Binary:
- Divide by 2 repeatedly, reverse the remainders.
Example: 13 -> 1101
Binary to Decimal:
- Multiply each bit by 2^position (right to left) and add.
Example: 1101 = 1x2^3 + 1x2^2 + 0x2^1 + 1x2^0 = 13
Decimal to Octal:
- Divide by 8 repeatedly, reverse the remainders.
Example: 65 -> 101
Number System - BCA 1st Year Notes
Octal to Decimal:
- Multiply each digit by 8^position and add.
Example: 157 = 1x8^2 + 5x8^1 + 7x8^0 = 111
Decimal to Hexadecimal:
- Divide by 16 repeatedly, convert remainders.
Example: 26 -> 1A
Hexadecimal to Decimal:
- Convert each digit to decimal, multiply by 16^position.
Example: 1A = 1x16^1 + 10x16^0 = 26