Title: Data Storage
1Data Storage
- Binary Digits
- (The Story of Boole 1850s and Shannon 1938)
2Electronic Speak
- In Paris they simply stared when I spoke to them
in French I never did succeed in making those
idiots understand their own language. - Mark Twain, The Innocents Abroad, 1869
- Electronic Machine understands on and off, so,
the Machine Alphabet is just two letters.
3Boolean Logic in Everyday Life
- Situations
- You have a buzzer in your car that sounds when
your keys are in the ignition and the door is
open. - Your fire alarm installed in your house will
sound if it senses heat or smoke. - There is a federal election coming up. People are
allowed to vote if they are a U.S. citizen and
they are 18. - Mr. Boole is giving his students an assignment.
To complete the assignment the students must do
a presentation or write an essay. - Stephanie is applying to a university Applied
Mathematics program. She must have already taken
Algebra, Calculus and Physics or Chemistry
4Deduction One form of Logic
- Premise John is a human
- Premise Humans are greedy
- Conclusion John is greedy
- Deductions of this type is formally known as
syllogistic logic, and the above assertion is
known as a syllogism
5Logic is
- concerned with the formal techniques of making
conclusions from premises - concerned with the validity of the argument,
not the accuracy of the premises
6Logic Question
- Humans have wings and can fly
- Jane is a human
- Therefore, Jane has wings and can fly
- Is this argument logical?
- Is this argument true?
7Ambiguity in Logic
- Logic is focused on arguments, not expression.
Logic does not address ambiguity of expression - Mom You may have ice cream if you eat your
dinner and do your homework or clean your room. - May I have ice cream if I do not eat my dinner
and I finish the homework?
8ExerciseAmbiguity in Logic
- Question Given 1) or 2) below, would you be able
to solve the problem What is the value of (2x -
4) / (30 - 2y) ? - 1) x 3
- 2) y gt 4
- Select an answer from the five choices a) - e).
- a) One (1) alone is sufficient to answer the
question. - b) Two (2) alone is sufficient to answer the
question. - c) Both alone are sufficient to answer the
question. - d) Together, both are sufficient to answer the
question. - e) Neither are sufficient to answer the question.
9Algebra
- Informally, algebra is the branch of mathematics
that works with expressions and variables - More formally, an algebra is a set of axioms,
operations, and values, i.e. - A a,o,v
10Algebra
- You have already encountered normal algebra
- Operations Addition, Subtraction,
Multiplication, Division - Values 0, 1, 2, 3, 4, 5, 6, 7, 8,
- Axioms 1n n for all n
- 0n n for all n
- etc
11Boolean Algebra
- Operations
- AND ( or something looking like multiplication)
- OR ( or something looking like addition)
- NOT ()
- Values
- TRUE (1)
- FALSE (0)
12Why study Boolean Algebra?
- Boolean algebra supports the notions of addition,
subtraction, multiplication, and division
familiar to you from normal arithmetic - These arithmetic operations can be expressed in
terms of Boolean AND, OR, and NOT operators using
the binary representation of numbers
13Notational Remarks
- Boolean Operators are often spelled out for
clarity - X Y X OR Y
- X Y X AND Y
- X NOT(X)
14Truth Tables
- Truth tables are intended as an easy way to
evaluate Boolean algebra operations and
expressions - Truth tables list the premises and conclusions.
Premises are often referred to as input, and
conclusions as output. - Typical Truth Tables only deal with TRUE
FALSE inputs which maybe represented by 1 or 0
respectively.
15Truth Tables
16Truth Tables
17Truth Tables
18Operands and Results
- Notice that AND and OR accepts two operands as
input, and produces a single result - The NOT operator accepts one operand as input,
and produces a single result - Operands Input Premises
- Results Output Conclusions
19Expressions
- Algebraic expressions are a way to communicate a
series of operations and the order in which they
are performed - Expressions are algorithms for producing a
specific output from a specific input
20Expressions
- Expressions use variables instead of actual
values variables are considered placeholders
(or, containers) that will assume specific
values (or, contain the value) when the
expression is evaluated - Z (A B)
21Expressions
- The action of associating a specific value to a
variable is known as binding. - Expressions are evaluated by binding the
variables and then performing the operations
indicated
22Expressions
- Parenthesis are NOT operators, but are included
in expressions to indicate the order in which
operations should be performed - Expressions are evaluated inside out, i.e.
operations inside parenthesis are performed
first, and the results are used in subsequent
steps of the evaluation
23Boolean Expressions
- Z (A or B)
- Z equals A or B
- A 1, B 0 ? Z 1
- Z (A and B) or A
- A 1, B 0 ? Z 1
- Z A and (B or A)
- A 1, B 0 ? Z ?
24Exercise Evaluating Expressions
- Purpose Practice evaluating expressions
- Who Pairs only
- Task Evaluate the Boolean expressions on the
following slide. Find the value of the
expression. - Product Present value of expression when
requested - Time Limit 5 minutes
25Exercise Expressions
- A 1, B 0, C 1
- (A or B)
- (A or B) and C
- A and (B or C)
- ((not C) and A) or B
26Expressions Answer
- A 1, B 0, C 1
- (AB) 1 OR 0 1
- (AB)C (1 OR 0) AND 1 1
- A (BC) 1 OR (0 AND 1) 1
- (C A) B (0 AND 1) OR 0 0
27Algebra and Logic
- Algebra may be thought of as logic plus
- Boolean algebra can address some issues of
ambiguity that exist in syllogistic logic
28Algebra and Logic
- Boolean algebra forces one to interpret the
ambiguity one of the two candidate
representations must be selected - Both statements are unambiguous, but have
different results
29Boolean Operations
Figure 1.1The Boolean operations AND, OR, and XOR
30Computer Hardware
- At a hardware level a computer is a series of
interconnected switches that either allow current
to pass or prevent current from passing - Switches are called transistors when you talk to
a hardware engineer
31Transistors
- A transistor is an on/off switch with no moving
parts except electrons, the movement of which
constitutes an electric current
T
32Controlling Transistors
- The switch state of a transistor changes when a
current is applied to the control - Transistors that are normally open will close
when a current is applied - Transistors that are normally closed will open
when a current is applied
33Gates
- Transistors are used to build components called
logic gates, or simply gates - Types of gates are
- AND gate
- OR gate
- NOT gate
34Logic Gates AND, OR
Figure 1.2 (A)A pictorial representation of AND,
OR, XOR, and NOT gates as well as their input and
output values
35Logic Gates XOR , NOT
Figure 1.2 (B)A pictorial representation of AND,
OR, XOR, and NOT gates as well as their input and
output values
36Transistors and Boolean Logic
- In a normally open transistor, current flows if
and only if both the In and Control
components have current - Out 1 if and only if In AND Control 1
- A normally open transistor implements the AND
operator
37Transistors and Boolean Logic
- In a normally closed transistor, current flows if
and only if there is current applied to In and
no current applied to Control. If In is set
with a permanent current then Control is always
the reverse of Out - Control NOT Out or Out NOT Control
- A normally closed transistor implements a NOT
operator
38Transistors and Boolean Logic
- OR operator is not fundamental
- P OR Q is the same as
- NOT((NOT P) AND (NOT Q))
- OR operator can be implemented using a
combination of AND and NOT operators
39Practical Logic
- Contrariwise, continued Tweedledee, if it was
so, it might be and if it were so, it would be
but as it isnt, it aint. Thats logic. - -Lewis Carroll, Alices Adventures in
Wonderland, 1865
40Gates and Expressions
- Logic gates are physical constructions that
implement AND, OR, and NOT logical operations - Logic gates are used to build electrical circuits
that implement logical expressions - Anything that can be represented by a logical
expression can be implemented in a hardware
circuit
41Arithmetic Circuits
- Arithmetic operations can be represented as
Boolean expressions, so hardware circuits can be
built to add, subtract, multiply, and divide two
numbers - Numbers are represented in binary form, which we
will discuss further in the next lecture
42Circuit Simulator
- There are a few circuit simulators available from
other universities online to explore some of
these concepts. One is located at - http//www.math-cs.gordon.edu/courses/cs111/module
7/logic-sim/example1.html
43Memory Circuits
- So, whats so special about all this?
- Boolean logic allows for the creation of
circuits that remember their previous state.
These are called flip flops and are discussed
in the text. - We will study the flip-flop example in the text,
Fig 1.3., Page 22.
44Flip-Flop Circuit
Figure 1.3A simple flip-flop circuit
45Manipulating output from flip-flop
Figure 1.4 (A)Setting the output of a flip-flop
to 1
46Setting the output of a flip-flop
Figure 1.4 (B)Setting the output of a flip-flop
to 1
47Setting the output of flip-flop to 1
Figure 1.4 (C)Setting the output of a flip-flop
to 1