Lecture BinaryNumberSystem
Lecture BinaryNumberSystem
Recitation – 15%
Assignment – 5%
Laboratory
Machine Problems – 40%
NO ID means 1 absence.
ANY QUESTIONS?
The Binary Number
System
What is binary?
First invented by Gottfried Leibniz in the 17th
century, the binary number system became widely
used once computers required a way to represent
numbers using mechanical switches.
Binary describes a numbering scheme in which
there are only two possible values for each digit --
0 or 1 -- and it is the basis for all binary code used
in computing systems.
10101101
11111111
10000001
11101111
27
Note: The remainders incurred when the given
13 1 decimal number is divided by 2 shall form the
binary equivalent. The division will only terminate
6 1 when the quotient becomes 0.
3 0
1 1
0 1
64 26 213 8192
To Decimal To Binary
11101101 342
10011101 1703
Addition
CARRY
Basic Examples:
0 + 0 = 0
1 + 0 = 1 a b. 1 1 1 1 1
0 + 1 = 1 1 1 0 0 1 0 1 1 0 0 1 1
+ +
1 + 1 = 10 0 1 0 0 1 1 1 1 0 1
1 1 1 0 1 1 1 0 1 0 0 0 0
54 and 17
48 and 75
0 x 1 = 0 a.
1 x 0 = 0
1 1 0 1 0 1
1 x 1 = 1 x
1 1
CARRY 1 1 1 0 1 0 1
+
1 1 0 1 0 1
1 0 0 1 1 1 1 1
Subtraction
Basic: Examples:
0–0=0 a.
1–0=1 1 1 0 1 1 1
- 1 0 0 1 0 1
1–1=0
0 1 0 0 1 0
0–1=?
b.
borrow
0 10 0 10
1 0 0 1 1 0
- 1 0 1 0 1
0 1 0 0 0 1
0 10
1 0 0 1
- 1 1 0 1
1 0 0
101100 -12
000101 5
100101 -5
110011 -12
000101 5
111010 -5
001100 12
110100 -12