Lecture 4 - Binary System and Logic Gates
Lecture 4 - Binary System and Logic Gates
Information Systems
IS 201
Lecture 4
n When you see a number like "123", you don't think about the
value 123. Instead, you generate a mental image of how
many items this value represents. In reality, the number 123
represents:
1 * 102 + 2 * 101 + 3 * 100 =
1 * 100 + 2 * 10 + 3 * 1 =
100 + 20 + 3 =
123
Lecture 4 – Binary System and Logic Gates
Decimal Number System (Cont.)
n Each digit appearing to the left of the decimal point
represents a value between zero and nine times power of ten
represented by its position in the number.
n Digits appearing to the right of the decimal point represent a
value between zero and nine times an increasing negative
power of ten.
n For example, the value 725.194 is represented as follows:
7*102 + 2*101 + 5*100 + 1*10-1 + 9*10-2 + 4*10-3 =
7*100 + 2*10 + 5*1 + 1*0.1 + 9*0.01 + 4*0.001 =
700 + 20 + 5 + 0.1 + 0.09 + .0004 =
725.194
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E, and F
n Example: 85.125
n 8510 = 10101012 and 0.12510 = 0012
1. Binary Addition
2. Binary Subtraction
0+0 0 0
0+1 1 0
1+1 0 1
1+1+1 1 1
Carry values
11
110010
+
100111
1011001
Lecture 4 – Binary System and Logic Gates
Exercises
1. Convert the following numbers into decimal numbers
n (01)2, (111)2, (10011.11)2, (11010.101)2
2. Convert the following numbers into octal/hex
n (01)2, (101111)2, (10011)2, (11011010)2
3. Convert the following numbers into binary numbers
n (0)10, (10)10, (56)10, (169)10
n (135)8, (021)8, (703)8
n (135)16, (0A1)16, (0E)16
4. Perform the following binary operations
n 11 + 11, 1101 + 111, 11111 + 100011
n Signed magnitude
n One’s complement
n Two’s complement
Basic Gates
Symbols
Truth Tables
a b F
0 0 1 Truth table
captures every
0 1 0 input/output
1 0 0 possible for circuit
1 1 1
1. For each line with output 1 in the truth table, build a product
term using AND and NOT
2. Combine together all product terms with ORs
a b F
0 0 1
0 1 0
1 0 0
1 1 1
1. For each line with output 1 in the truth table, build a product
term using AND and NOT
2. Combine together all product terms with ORs
a b F
0 0 1
Writing a Logic0Expression
1 From
0 a Truth Table
https://www.youtube.com/watch?v=uZel7wLztM0
1 0 0
1 1 1
b1
1-CE
AND
F
gate
a2
1-CE
b2
a3
b2
1-CE
x
y
y
x 𝒙+𝒚
y (𝒙 + 𝒚)$
𝒚
$
𝒚
y
n .
Answer: 𝒙 + 𝒚 - 𝒚
x
y
$
𝒙
x $'𝒚
𝒙 $ $'𝒚
𝒙 $
$
𝒚
y
n .-𝒚
Answer: 𝒙 . =𝒙+𝒚
x 𝒙+𝒚
𝒙+𝒚
𝒙+𝒚 𝒙
y
x
y Sum
Carry
Lecture 4 – Binary System and Logic Gates
Examples of Essential Circuits in Digital
Logic Design
n Performing arithmetic operations
n Half-adder and full-adder
n Executing logic operations
n Compare for equality
n Providing memory capabilities
(AB + AC)
(AB + AC)