Вы находитесь на странице: 1из 4

MODULE 1: COMPUTER ARCHITECTURE AND ORGANISATION

Objective: describe the basic building blocks of a computer

A proposition, p, is a statement which is either true or false (called its truth value).
For example, the following are propositions:
1. The sun is shining.
2. The sum of two prime numbers is even.
3. 4 + 5 = 9
4. n is a prime number.
5. The moon is made of green cheese.
Truth tables
Truth tables represent the relationship between the truth values of propositions and compound propositions
formed from those propositions.

Negation (~)
p ~p
T F
F T

If a proposition p is true, its negation ~p is false. Notice that negation is a logical operation on a single
proposition.
Logical AND (Ù) – conjunction
p q pÙq p q pÙq
T T T 1 1 1
T F F 1 0 0
F T F 0 1 0
F F F 0 0 0

The second table is an alternative representation of the first where true is represented by 1 and false is
represented by 0.
In the truth table above, we see that the truth value of both propositions must be true, for AND to be true.
Consider the following propositions:
p: It is raining.
q: It is cold.
pÙq is only true if it is raining and it is cold, i.e, both propositions must be true.

Logical OR (Ú) – disjunction


p q pÚq p q pÚq
T T T 1 1 1
T F T 1 0 1
F T T 0 1 1
F F F 0 0 0

Given two propositions, p and q, pÚq is true is either p is true and/or q is true. Note that only one proposition
has to be true, but both can also be true for pÚq to be true. For this reason, OR is also called inclusive OR or
inclusive disjunction.

Conditionality (®) – implication


p q p®q p q p®q
T T T 1 1 1
T F F 1 0 0
F T T 0 1 1
F F T 0 0 1
p®q is read “p implies q” or “if p then q”. Consider the following situations:

Example 1
If you get an A, then I'll give you a dollar.

The statement will be true if I keep my promise and false if I don't.


Suppose it's true that you get an A and it's true that I give you a dollar. Since I kept my promise, the implication
is true. This corresponds to the first line in the table.
Suppose it's true that you get an A but it's false that I give you a dollar. Since I didn't keep my promise, the
implication is false. This corresponds to the second line in the table.
What if it's false that you get an A? Whether or not I give you a dollar, I haven't broken my promise. Thus, the
implication can't be false, so (since this is a two-valued logic) it must be true. This explains the last two lines of
the table.

Example 2
If you score 85% or above in this class, then you will get an A.

Suppose you score a 90% in the class. If your final grade is an A, then the promise was kept and Statement 1 is
true. If your grade is not an A, then the promise was broken and Statement 1 is false.
But what if you do not score 85% or above? Is Statement 1 true or false in this case? Statement 1 does not say
what grade you will receive if you score less than 85%. If you score 75% in the class and receive a B, you
cannot complain that the promise was broken. If you score 84% and end up with an A, you still cannot say that
the promise was broken.

Bi-conditionality/ If and only if («)

p q p«q p q p«q
T T T 1 1 1
T F F 1 0 0
F T F 0 1 0
F F T 0 0 1
p«q means that p and q are equivalent. So, the double implication is true if p and q are both true or if p and q
are both false; otherwise, the double implication is false.

NOTE:
A tautology is a formula which is "always true" --- that is, it is true for every assignment of truth values to its
simple components. You can think of a tautology as a rule of logic.
The opposite of a tautology is a contradiction, a formula which is "always false". In other words, a
contradiction is false for every assignment of truth values to its simple components.

Exercise
1. Show that (p ® q) Ú (q ® p) is a tautology.
2. Construct a truth table for (p ® q) Ù ( q ® r).
3. Show that p ® q and ~p Ú q are logically equivalent.
4. Write down the negation of the following statements, simplifying so that only simple statements are
negated.

(a) p Ú ~q
(b) (p Ù q) ® r

Вам также может понравиться