Lecture4 (Number Systems & Binary Logic)
Lecture4 (Number Systems & Binary Logic)
Lecture # 4:
Number systems and Logical Operations
Today’s Aim
Number Sense
Counting
History of Number Systems:
Decimal
Binary
Hexadecimal
Decimal Number System:
Binary to Decimal:
10112 = 1* 20 + 1* 21 + 0* 22 + 1* 23
= 1+2+0+8 = 11
2 5 - 1
Decimal to Binary: 2 2 - 0
510 = 1012 1
Conversion (continued):
Hexadecimal to decimal:
DEAD16 = ?
Decimal to hexadecimal:
20710 = ?
Data Organization:
Bits (Binary Digits)
Nibbles = 4 bits
Bytes = 8 bits
Word = 16 bits
Logical Operations
Truth table
Contains all the possible input values and their
outputs
2n entries of a truth table show all the possible
input combinations (n = number of inputs)
Boolean expression
Consists of Boolean variables
Another way to represent the input-output
relationship
Logical Operations
x
x y z z
y
0 0 0
0 1 0
Boolean Equation
1 0 0
z x y
1 1 1
Logic OR:
x
x y z z
y
0 0 0
0 1 1
Boolean Equation
1 0 1
1 1 1
z x y
Logical NOT:
x y
x y
0 1
1 0 Boolean Equation
y x'
Logic NAND:
x y z x
z
y
0 0 1
0 1 1
Boolean Equation
1 0 1
1 1 0 z x y
Logic NOR:
x y z x
z
y
0 0 1
0 1 0
Boolean Equation
1 0 0
1 1 0 z x y
Logic XOR:
x
x y z z
y
0 0 0
0 1 1
Boolean Equation
1 0 1
1 1 0 z x y
Logic XNOR:
x y z x
z
y
0 0 1
0 1 0
Boolean Equation
1 0 0
1 1 1 z=x y
Today we Learnt:
Binary Logic