You are on page 1of 32

Logical Argument and

Logic Gates
Pre IGCSE

1
The CPU and Logic
What is logic?
• A logic statement can be used to say if something is true or false.

Logic and the ALU

⮚The computer is a digital device. A computer processor is made of


electrical switches. The electrical switches in a computer can be on
or off. A computer is called a two-state device.
⮚Logic also has two states. The two states are true and false. A logic
statement can be true or it can be false. 2
Linking logical statements
⮚ Logical statements can also be used to draw conclusions from data and
make decisions.

Parts of a logical statements

Proposition Conclusion
Player had no lives THEN Game is over

⮚ In a logical statement, everything to the left of THEN is called the proposition.


⮚Everything to the right of THEN is called the conclusion.
⮚The whole statement is called a logical argument.
3
Truth Tables
• A truth table is a way of laying out a logical statement in the table form.
• There are four steps in creating a truth table.
1. Write out the argument. Always write THEN in upper-case letters to show that it links
the statements:
Player has no lives THEN Game is over
2. Create the column headings. There are only two statements. Always write the
conclusion in the last column on the right. There is no need to use THEN in the table.
Player has no lives Game is over

2. Add a row for every possible response to the proposition.

2. Complete the conclusion column. Fill in the correct value for each possible response to
the proposition.
4
Activity 5
► Write a logical statement. Draw the truth table for your statement.
example
6
► The football club want to sign a new star player. The manager has asked the
team owner to sign a player who scored 30 goals last season. The manager
also wants the player to be left-footed. So the key points:
► Club sign player
► Player is left-footed
► Player scored 30 goals.
Using AND to link logical statements
Player is left-footed AND Player scored 30 goals THEN Club signs player.

Player is left-footed Player scored 30 Club signs player


goals
FALSE FALSE FALSE
FALSE TRUE FALSE
TRUE FALSE FALSE
TRUE TRUE TRUE

7
Activity 1 8

1. Sonia wants to buy her mother a presenter. She wants to buy a blue vase.
She has $5 saved for the present. She sees a vase in a shop window. Write a
logical argument and truth table to determine if she can buy the vase.
9
2. Mr. John is trying to figure out if he can have buttered toast for breakfast.
Write the logical argument and a truth table for butter toast.
There is bread in the cupboard AND there is butter in the fridge THEN Toast for
breakfast.

Mr.John Mr. John Explanation Toast for


has bread has butter breakfast
FALSE FALSE There is no bread AND there is no butter. FALSE
FALSE TRUE There is no bread AND there is butter. FALSE
TRUE FALSE There is bread AND there is no butter. FALSE
TRUE TRUE There is bread AND there is butter. TRUE
Activity 2 10

1. A bank is equipped with a high security safe. To open


the safe:
► a key must be turned in a lock
► a personal pin number must be entered
► the alarm must be turned off.

Write the logical argument and a truth table.


Using OR to link logical statements 11
► An extra life is awarded in a computer game if the player reaches 10,000
points or collects five stars during a game.
Using OR to link logical statements 12

10,000 points reached OR five stars collected THEN extra life awarded.

10,000 points Five stars Extra life


FALSE FALSE FALSE
FALSE TRUE TRUE
TRUE FALSE TRUE
TRUE TRUE TRUE
Activity 3 13

A building is equipped with smoke sensors and heat


sensor. If either sensor is triggered, an alarm must sound
so that the building can be cleared. Write a logical
argument and truth table to describe this system.
Logic Gates

14
Objectives
❖ How to describe the AND, OR and NOT logic
gates used in a computer
❖ How to draw truth tables for AND, OR and NOT
gates
❖ How computer logic gates compare to logic in the
real world

15
Computer can carry out complicated tasks such as creating realistic game
worlds. It can navigate spacecraft through space. How is this possible when
computer is only made up of switches that can be turned on or off?
Those switches can be combined into larger units The larger units can perform
more complicated tasks Those units are called gates.
Logical statements using AND and OR can be used to describe situations in
everyday life and in computer games. To control programs such as games,
computer’s ALU uses logic gates.

16
Gates

❖ The CPU is made up of millions of on-off switches. Those switches


are organised into larger units called gates.
❖ Electronic circuits in computers, solid state drives and controlling
devices are made up of thousands of logic gates.
❖ Logic gates take binary inputs and produce a binary output. Several
logic gates combined together form a logic circuit and these circuits
are designed to carry out a specific function.
❖ The checking of the output from a logic gate or logic circuit is done
using a truth table.
17
AND gate
The AND gate has two inputs. They are called A
and B. The gate is inside the CPU so it can only
understand binary. The value of each input can A B C
be either 0 or 1. The output of an AND gate is 1
if both input A and B are 1. Otherwise it is 0. 0 0 0
0 1 0
1 0 0
1 1 1

An AND gate will give high output if both of the inputs is high. 18
OR gate
The OR gate has two inputs. They are called A
and B. The value of each input can be either 0 or
1. The output of an OR gate is 1 if either input A A B C
and B are 1. Otherwise it is 0.
0 0 0
0 1 1
1 0 1
1 1 1
An OR gate will give high output if either of the inputs is high. 19
https://circuitverse.org/simulator
20
21
The NOT gate
A NOT gate has only one input and one output.
A NOT gate reverses the input. If the input is 1
the output is 0. If the input is 0 the output is 1.
A B

0 1
1 0

A NOT gate has only one input. It will give a high output if theinput is low.
22
Draw the truth table for the circuits.

A B C D (NOT A) E ( B AND C) X
0 0 0 1 0 1
0 0 1 1 0 1
0 1 0 1 0 1
0 1 1 1 1 1
1 0 0 0 0 0
1 0 1 0 0 0
1 1 0 0 0 0
1 1 1 0 1 1
23
Draw the truth table for the circuits.

A B C D (A OR B) E (NOT C) X
0 0 0 0 1 0
0 0 1 0 0 0
0 1 0 1 1 1
0 1 1 1 0 0
1 0 0 1 1 1
1 0 1 1 0 0
1 1 0 1 1 1
1 1 1 1 0 0
24
The NAND gate (NOT AND)

The output of a NAND gate is 1 if both input A B C


A AND B are NOT both 1. 0 0 1
0 1 1
1 0 1
1 1 0

A NAND gate will give a low output if all the inputs is high.
25
The NOR gate (NOT OR)

A B C
The output of an XOR gate is 1 if neither
0 0 1
input A and B are 1.
0 1 0
1 0 0
1 1 0

The output of a NOR gate is high if the inputs are low.


26
The XOR gate

A B C
The output of an XOR gate is 1 if neither
0 0 0
input A and B are 1.
0 1 1
1 0 1
1 1 0

The output of a XOR gate is high if the inputs are not the same.
27
The XNOR gate

The output of an XOR gate is 1 if the inputs A B C


are the same.
0 0 1

0 1 0

1 0 0

1 1 1

The output of a XOR gate is high if the inputs are the same.
28
Circuits
Gates become more powerful and
more useful when they are joined
A B C Z
together When gates are joined
0 0 0 1
together, they form a circuit.
0 1 0 1

1 0 0 1

1 1 1 0
29
Draw the truth table for the circuits.

30
Draw the truth table for the circuits.

31
Draw the truth table for the circuits.

32

You might also like