COMPUTER ARCHITECTURE & ORG (UNIT -1)
A number system is a way to represent numbers using a consistent set of symbols and rules. It's
fundamental to mathematics and computing. Here are the most common number systems:
1. Decimal Number System (Base 10)
Digits Used: 0–9
Most commonly used system in daily life.
Each digit's place value is a power of 10.
o Example: 245=2×102+4×101+5×100245 = 2×10^2 + 4×10^1 +
5×10^0245=2×102+4×101+5×100
2. Binary Number System (Base 2)
Digits Used: 0, 1
Used by computers and digital systems.
Each digit’s place value is a power of 2.
o Example: 10112=1×23+0×22+1×21+1×20=11101011_2 = 1×2^3 + 0×2^2 + 1×2^1 +
1×2^0 = 11_{10}10112=1×23+0×22+1×21+1×20=1110
3. Octal Number System (Base 8)
Digits Used: 0–7
Sometimes used in computing (especially older systems).
Each digit’s place value is a power of 8.
o Example: 178=1×81+7×80=151017_8 = 1×8^1 + 7×8^0 = 15_{10}178
=1×81+7×80=1510
4. Hexadecimal Number System (Base 16)
Digits Used: 0–9 and A–F (A=10, B=11, ..., F=15)
Used in computing for memory addresses, color codes, etc.
Each digit’s place value is a power of 16.
o Example: 1A16=1×161+10×160=26101A_16 = 1×16^1 + 10×16^0 = 26_{10}1A1
6=1×161+10×160=2610
Binary Number System (Base 2)
The binary number system is one of the most important number systems in computing and digital
electronics. It uses only two digits: 0 and 1.
BASICS OF BINARY
Base: 2
Digits: Only 0 and 1
Each position in a binary number represents a power of 2 (starting from right to left):
Binary Number: 11012=1×23+1×22+0×21+1×20=1310\text{Binary Number: } 1101_2 = 1×2^3 + 1×2^2 +
0×2^1 + 1×2^0 = 13_{10}Binary Number: 11012=1×23+1×22+0×21+1×20=1310
Binary to Decimal Conversion
To convert a binary number to decimal, multiply each bit by 2 raised to its position (starting from right,
index 0):
Example:
10102=1×23+0×22+1×21+0×20=8+0+2+0=10101010_2 = 1×2^3 + 0×2^2 + 1×2^1 + 0×2^0 = 8 + 0 + 2 + 0 =
10_{10}10102=1×23+0×22+1×21+0×20=8+0+2+0=1010
Decimal to Binary Conversion
Divide the number by 2, record the remainder, and continue dividing until the quotient is 0. Then read
the remainders from bottom to top.
Example: Convert 13 to binary
13 ÷ 2 = 6 remainder 1
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Binary: 1101
Binary Arithmetic
1. Addition Rules
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10 (i.e., 0 carry 1)
Example: 1011 + 110
1011
+ 110
-------
10001
2. Subtraction, Multiplication, Division also follow logical rules similar to decimal, but using only 0 and 1
Where Binary Is Used
Computers and microprocessors
Logic circuits and digital electronics
Networking (IP addresses)
Data encoding (text, images, sound)
OCTAL NUMBER SYSTEM (BASE 8)
The octal number system uses 8 digits: 0 to 7 and is often used as a shorthand for binary in computing
because each octal digit maps neatly to 3 binary digits.
Basics of Octal
Base: 8
Digits Used: 0, 1, 2, 3, 4, 5, 6, 7
Each position represents a power of 8, starting from the right:
1258=1×82+2×81+5×80=64+16+5=8510125_8 = 1×8^2 + 2×8^1 + 5×8^0 = 64 + 16 + 5 = 85_{10}1258
=1×82+2×81+5×80=64+16+5=8510
Octal to Decimal Conversion
Multiply each digit by a power of 8 (starting from the right, exponent 0).
Example:
738=7×81+3×80=56+3=591073_8 = 7×8^1 + 3×8^0 = 56 + 3 = 59_{10}738=7×81+3×80=56+3=5910
Decimal to Octal Conversion
Use repeated division by 8, and read the remainders from bottom to top.
Example: Convert 85 to octal
85 ÷ 8 = 10 remainder 5
10 ÷ 8 = 1 remainder 2
1 ÷ 8 = 0 remainder 1
Octal: 125
Binary ↔ Octal Conversion
Why it’s easy: Every octal digit is equal to 3 binary digits (bits).
Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
✅ Binary to Octal
Group binary digits in sets of 3 from right, then convert.
Example: 1101011₂ → ?₈
1101011 → 001 101 011
→ 1 5 3
= 153₈
✅ Octal to Binary
Convert each octal digit to its 3-digit binary equivalent.
Example: 237₈ = ?₂
2 → 010
3 → 011
7 → 111
Binary: 010011111₂
Octal Arithmetic
Addition Example:
25₈
+ 13₈
-------
40₈
(Equivalent to 21 + 11 = 32 in decimal)
Where Octal Is Used
Legacy systems (like early UNIX permissions)
Shorter representation of binary (used in machine-level programming)
Embedded systems and digital electronics
Hexadecimal Conversion (Base 16)
The hexadecimal (hex) number system uses 16 symbols:
Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Where: A=10, B=11, C=12, D=13, E=14, F=15
1. Hexadecimal to Decimal
Multiply each digit by powers of 16 (starting from the right).
Example: Convert 2F to decimal
2F₁₆ = (2 × 16¹) + (15 × 16⁰)
= 32 + 15 = 47₁₀
2. Decimal to Hexadecimal
Use repeated division by 16, and read remainders bottom to top.
Example: Convert 156 to hexadecimal
156 ÷ 16 = 9 remainder 12 → C
9 ÷ 16 = 0 remainder 9
So, 156 = 9C₁₆
3. Binary ↔ Hexadecimal Conversion
Each hex digit = 4 binary digits (bits), making conversion very fast.
Hex Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
Hex Binary
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
✅Example: Binary to Hex
Convert 11010111₂ to hex
Group in 4s from the right:
1101 0111 → D7₁₆
✅ Example: Hex to Binary
Convert A3₁₆ to binary
A → 1010
3 → 0011
So: A3₁₆ = 10100011₂