Computer Architecture Unit -1 Notes
Computer Architecture Unit -1 Notes
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:
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
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):
To convert a binary number to decimal, multiply each bit by 2 raised to its position (starting from right,
index 0):
Example:
Divide the number by 2, record the remainder, and continue dividing until the quotient is 0. Then read
the remainders from bottom to top.
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)
1011
+ 110
-------
10001
2. Subtraction, Multiplication, Division also follow logical rules similar to decimal, but using only 0 and 1
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:
Multiply each digit by a power of 8 (starting from the right, exponent 0).
Example:
Use repeated division by 8, and read the remainders from bottom to top.
85 ÷ 8 = 10 remainder 5
10 ÷ 8 = 1 remainder 2
1 ÷ 8 = 0 remainder 1
Octal: 125
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
Example: 1101011₂ → ?₈
Example: 237₈ = ?₂
2 → 010
3 → 011
7 → 111
Binary: 010011111₂
Octal Arithmetic
Addition Example:
25₈
+ 13₈
-------
40₈
(Equivalent to 21 + 11 = 32 in decimal)
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
2. Decimal to Hexadecimal
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
A → 1010
3 → 0011
So: A3₁₆ = 10100011₂