Boolean - Logic
Boolean - Logic
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
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.
IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science
• 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
▪ 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
IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science
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
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
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
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
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
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
IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science
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
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
IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021
IGCSETM and O Level Computer Science
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
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
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
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
Solve:
IGCSETM and O Level Computer Science Boost © Hodder & Stoughton 2021