Title: Computer Science 101
1Computer Science 101
- Logic Gates and Simple Circuits
2Transistor - Electronic Switch
- Base High (5v or 1) Makes connection
- Base Low (0v or 0) Disconnects
- Say, 500 million transistors on a chip 1 cm2
- Change states in billionth of sec
- Solid state
3Moores Law
In 1965, Intel co-founder Gordon Moore saw the
future. His prediction, now popularly known as
Moore's Law, states that the number of
transistors on a chip doubles about every two
years.
4Gates
- A gate is an electronic device that takes 0/1
inputs and produces a 0/1 result.
5NOT Gate
- Input High (5v or 1) Output Low (0v or 0)
- Input Low (0v or 0) Output High (5v or 1)
- Output is opposite of Input
5v
Output
Input
Ground
6AND Gate
5v
- Output is 1 only if
- Input-1 is 1 and
- Input-2 is 1
- Output Input1 AND Input2
Output
7OR Gate
- Output is 1 if
- A is 1 or if
- B is 1
- Output A OR B
8Boolean Expression ? Python
- Logical operators
- AND ? and (Python)
- OR ? or (Python)
- NOT ? not (Python)
- NOT ((xgty) AND ((x5) OR (y3))
- not((xgty) and ((x5)or(y3)))
- while (not((xgty) and ((x5)or(y3))))
9Abstraction
- In computer science, the term abstraction refers
to the practice of defining and using objects or
systems based on the high level functions they
provide. - We suppress the fine details of how these
functions are carried out or implemented. - In this way, we are able to focus on the big
picture. - If the implementation changes, our high level
work is not affected.
10Abstraction Examples
- Boolean algebra - we can work with the Boolean
expressions knowing only the properties or laws -
we do not need to know the details of what the
variables represent. - Gates - we can work with the logic gates knowing
only their function (output is 1 only if inputs
are ). Dont have to know how gate is
constructed from transistors.
11Boolean Exp ? Logic Circuit
- To draw a circuit from a Boolean expression
- From the left, make an input line for each
variable. - Next, put a NOT gate in for each variable that
appears negated in the expression. - Still working from left to right, build up
circuits for the subexpressions, from simple to
complex.
12Logic Circuit _ ____ AB(AB)B
Input Lines for Variables
A
B
13Logic Circuit _ ____ AB(AB)B
NOT Gate for B
A
B
_ B
14Logic Circuit _ ____ AB(AB)B
_ Subexpression AB
_ AB
A
B
_ B
15Logic Circuit _ ____ AB(AB)B
Subexpression AB
_ AB
A
AB
B
_ B
16Logic Circuit _ ____ AB(AB)B
___ Subexpression AB
_ AB
A
____ AB
AB
B
_ B
17Logic Circuit _ ____ AB(AB)B
___ Subexpression (AB)B
_ AB
A
____ AB
AB
B
_ B
____ (AB)B
18Logic Circuit _ ____ AB(AB)B
Entire Expression
19Logic Circuit ? Boolean Exp
- In the opposite direction, given a logic circuit,
we can write a Boolean expression for the
circuit. - First we label each input line as a variable.
- Then we move from the inputs labeling the outputs
from the gates. - As soon as the input lines to a gate are labeled,
we can label the output line. - The label on the circuit output is the result.
20Logic Circuit ? Boolean Exp
_ _ ABAB
21Simplification Revisited
- Once we have the BE for the circuit, perhaps we
can simplify.
22Logic Circuit ? Boolean Exp
Reduces to
23The Boolean Triangle
Boolean Expression
Logic Circuit
Truth Table
24The Boolean Triangle
Boolean Expression
Logic Circuit
Truth Table
25If we only had an Al Gore Rhythm!