0% found this document useful (0 votes)
12 views54 pages

Boolean - Logic

The document discusses the importance of logic gates in computing, explaining how they form the basis of Boolean logic and decision-making in digital technology. It includes activities for identifying inputs and outputs in real-life situations, as well as designing logic circuits for specific conditions, such as a wind turbine safety system. The document also outlines the stages of creating logic circuits and provides examples of different types of logic gates.

Uploaded by

urvitchaturvedi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views54 pages

Boolean - Logic

The document discusses the importance of logic gates in computing, explaining how they form the basis of Boolean logic and decision-making in digital technology. It includes activities for identifying inputs and outputs in real-life situations, as well as designing logic circuits for specific conditions, such as a wind turbine safety system. The document also outlines the stages of creating logic circuits and provides examples of different types of logic gates.

Uploaded by

urvitchaturvedi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

IGCSETM and O Level Computer Science

Boolean logic

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Have you ever wondered how a sensor works? Or a buzzer? A house alarm?

Logic gates have been and will continue to be a fundamental part of computing as they are

responsible for every ‘decision’ a system makes in order to get an output.

Activity: Research and share how logic gates are involved in making sensors work.

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Logic gates are the building blocks that control every piece of digital technology around
you. All computer hardware and software operate using ‘Boolean logic’, and every line of
program code is based on controlling the inputs and outputs of logic gates using ‘logic
statements’.

By the end of this subtopic, you will understand what logic gates are, where they are used,
how Boolean logic works, and how to create logic statements for just about any situation
around you.

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Logic gates are based on transistors and work on ‘conditions’ much like the conditions
we have around us every day.

▪ You get an A* if you score 90 or above, water starts to boil if the temperature is 100
or above.

▪ For a computer, these conditions look a little different.


▪ For example, if the user clicks on a file, and if the file is available, the computer will
display that file.
▪ Conditions like these are then changed into a form of binary ( 11 s and 00 s),
and these are then ‘programmed’ into electronic circuits with the help of logic
circuits.

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Input and output

In any computing situation, it is essential to be able to identify the inputs required to


form the output desired. Sometimes this is not immediately obvious, so it can be
helpful to train yourself to identify inputs and outputs in real-life or mathematical
situations. Here are some examples:

• To make tea (the output ) you need water and tea leaves (the inputs ).
• When you add 2 and 3, you get 5. The inputs in this situation are the numbers 2 and
3. The output is the number 5.

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Activity

Real-life inputs and outputs:

▪ What are the essential inputs to get an electric kettle to work?

▪ Look around you. Can you spot any real-life situation where inputs are
required in order to produce an output?

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Solution

▪ Switched ON

▪ Electricity

▪ Water

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

14

Logic Gates
NOT, AND, OR, NAND, NOR, XOR

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

A NOT gate

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

An AND gate

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

An OR gate

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

A NAND gate

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

A NOR gate

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

An XOR gate

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

15

Logic Gates
Solving a logic circuit

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Solving a logic circuit

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Solving a logic circuit: Part 1

0 0 0
0 0 0
0 1 0
0 1 0
1 0 0
1 0 0
1 1 1
1 1 1

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Solving a logic circuit: Part 1

0 0 0 0 1
0 0 1 0 0
0 1 0 0 0
0 1 1 0 0
1 0 0 0 1
1 0 1 0 0
1 1 0 1 0
1 1 1 1 0

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Solving a logic circuit: Part 2

0 1 1
0 0 0
0 0 0
0 0 0
0 1 1
0 0 0
1 0 1
1 0 1

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Solving a logic circuit: Part 3

1 0 1
0 1 1
0 0 0
0 1 1
1 0 1
0 1 1
1 0 1
1 1 0

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Solving a logic circuit: Final solution

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

((A OR B)XOR (B NAND C)) OR C

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

16

Logic Gates
Designing a logic circuit

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Designing a logic circuit


A wind turbine safety system monitors:
▪ the speed of the turbine
▪ the temperature of the bearing
▪ the velocity of the wind.
Description Parameter Value Condition
Turbine
S
speed
Bearing
T
temperature
Wind
W
velocity

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Designing a logic circuit


A wind turbine safety system monitors:
▪ the speed of the turbine
▪ the temperature of the bearing
▪ the velocity of the wind.
Description Parameter Value Condition
Turbine
S
speed
Bearing
T
temperature
Wind
W
velocity

Shutdown conditions:
▪ S <= 1000 rpm and T > 80°C
▪ S > 1000 rpm and W > 120 kph
IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021 ▪ T <= 80°C and W > 120 kph
IGCSETM and O Level Computer Science

Designing a logic circuit


A wind turbine safety system monitors:
▪ the speed of the turbine
▪ the temperature of the bearing
▪ the velocity of the wind.
Description Parameter Value Condition
Turbine 0 <= 1000 rpm
S
speed 1 > 1000 rpm
Bearing 0 <= 80°C
T
temperature 1 > 80°C
Wind 0 <= 120 kph
W
velocity 1 > 120 kph

Shutdown conditions:
▪ S <= 1000 rpm and T > 80c
▪ S > 1000 rpm and W > 120 kph
IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021 ▪ T <= 80°C and W > 120 kph
IGCSETM and O Level Computer Science

Designing a logic circuit: Stages

1 Define logic statements from the problem


2 Generate a simple logic circuit for each logic
statement
3 Combine the simple circuits into a system circuit
4 Create a truth table for the system circuit

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Designing a logic circuit: Stage 1

Description Parameter Value Condition


Turbine 0 <= 1000 rpm
S
speed 1 > 1000 rpm
Bearing 0 <= 80°C
T
temperature 1 > 80°C
Wind 0 <= 120 kph
W
velocity 1 > 120 kph

Shutdown conditions:
▪ S <= 1000 rpm and T > 80°C S=0 AND T=1
▪ S > 1000 rpm and W > 120 kph
▪ T <= 80°C and W > 120 kph

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Designing a logic circuit: Stage 1

Description Parameter Value Condition


Turbine 0 <= 1000 rpm
S
speed 1 > 1000 rpm
Bearing 0 <= 80°C
T
temperature 1 > 80°C
Wind 0 <= 120 kph
W
velocity 1 > 120 kph

Shutdown conditions:
▪ S <= 1000 rpm and T > 80°C S=0 AND T=1
▪ S > 1000 rpm and W > 120 kph S=1 AND W=1
▪ T <= 80°C and W > 120 kph T=0 AND W=1

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Designing a logic circuit: Stage 2


Logic statements:

▪ S=0 AND T=1

▪ S=1 AND W=1

▪ T=0 AND W=1

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Designing a logic circuit: Stage 2


Logic statements:

▪ S=0 AND T=1

▪ S=1 AND W=1

▪ T=0 AND W=1

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Designing a logic circuit: Stage 3

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Designing a logic circuit: Stage 4


Logic statements:
INPUTS OUTPUT
▪ S=0 AND T=1 S NOT S T A
▪ S=1 AND W=1 0 1 0 0
0 1 1 1
▪ T=0 AND W=1 1 0 0 0
1 0 1 0

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Designing a logic circuit: Stage 4


Logic statements:
INPUTS OUTPUTS
▪ S=0 AND T=1 S T W A B
▪ S=1 AND W=1 0 0 0 0 0
0 1 0 1 0
▪ T=0 AND W=1 1 0 0 0 0
1 1 0 0 0
0 0 1 0 0
0 1 1 1 0
1 0 1 0 1
1 1 1 0 1

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Designing a logic circuit: Stage 4


Logic statements:
INPUTS OUTPUTS
▪ S=0 AND T=1 S T NOT T W A B C
▪ S=1 AND W=1 0 0 1 0 0 0 0
0 1 0 0 1 0 0
▪ T=0 AND W=1 1 0 1 0 0 0 0
1 1 0 0 0 0 0
0 0 1 1 0 0 1
0 1 0 1 1 0 0
1 0 1 1 0 1 1
1 1 0 1 0 1 0

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Designing a logic circuit: Stage 4


Logic statements:
INPUTS OUTPUTS
▪ S=0 AND T=1 S T W A B C D X
▪ S=1 AND W=1 0 0 0 0 0 0 0 0
0 1 0 1 0 0 1 1
▪ T=0 AND W=1 1 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0
0 0 1 0 0 1 0 1
0 1 1 1 0 0 1 1
1 0 1 0 1 1 1 1
1 1 1 0 1 0 1 1

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

▪ Activity 10.3 & 10.4

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science

Solve:

IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021

You might also like