Professional Documents
Culture Documents
Fundamentals
Lecture # 4:
Number systems and Logical Operations
Todays Aim
Numbers:
Number Sense
Counting
Decimal
Binary
Hexadecimal
Base-10 system
Examples:
Base-2 system
Examples:
Two symbols
0,1
1011001
Hexadecimal Number
System:
Sixteen symbols
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Conversion:
Binary to Decimal:
10112 = 1* 20 + 1* 21 + 0* 22 + 1* 23
= 1+2+0+8 = 11
Decimal to Binary:
510 = 1012
5 - 1
2 - 0
1
Conversion (continued):
Hexadecimal to decimal:
DEAD16 = ?
Decimal to hexadecimal:
20710 = ?
Data Organization:
Nibbles = 4 bits
Bytes = 8 bits
Logical Operations
Boolean expression
AND
OR
NOT
Logical Operations
AND
OR
NOT
Single input
single output
Logical Operations
Truth table
Boolean expression
Logical Operations
\0 or 1
Logic AND:
Truth Table
x y
0
0
1
1
0
0
0
1
0
1
0
1
Logical Diagram
x
y
Boolean Equation
z x y
Logic OR:
Logical Diagram
Truth Table
0
0
1
1
0
1
0
1
0
1
1
1
Boolean Equation
z x y
Logical NOT:
Truth Table
Logical Diagram
y
Boolean Equation
y x'
Logic NAND:
Logical Diagram
Truth Table
x y
0
0
1
1
0
1
0
1
1
1
1
0
Boolean Equation
z x y
Logic NOR:
Truth Table
Logical Diagram
x y
1
0
0
0
0
0
1
1
0
1
0
1
Boolean Equation
z x y
Logic XOR:
Logical Diagram
Truth Table
x
0
0
1
1
y
0
1
0
1
0
1
1
0
Boolean Equation
z x y
Logic XNOR:
Logical Diagram
Truth Table
x
y
Boolean Equation
z=x
Today we Learnt:
Binary Logic