Teaching Computing to GCSE Level with Python Session 3.
-
Upload
poppy-craig -
Category
Documents
-
view
220 -
download
4
Transcript of Teaching Computing to GCSE Level with Python Session 3.
![Page 1: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/1.jpg)
Teaching Computing to GCSE Level with PythonSession 3
![Page 2: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/2.jpg)
Your second starter!1. Convert these binary numbers to denary:
0 1 0 1 0 0 1 0 1 0 1 1 0 1 1 0
2. Convert the same numbers to hex
3. Convert these hex numbers to binary
A 3 4 F 2 4 2 9
4. Convert these binary numbers to hex
0 1 1 1 0 0 0 1 1 0 1 1 0 1 0 1
5. What is the largest denary number you can express in 9 bits?
6. How many different values can you show using 9 bits?
![Page 3: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/3.jpg)
Topics for todayTheory
Binary logic: AND, OR, NOT Truth tables Logic Gates www.logic.ly
Programming IF Statements
![Page 4: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/4.jpg)
Binary logicGCSE Computing link to specification
Recap on binary numbers
AND OR NOT
Truth tables
Logic diagrams
Logic.ly
![Page 5: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/5.jpg)
Link to specification(OCR GCSE Computing Specification)
Candidates should be able to:
(d) explain why data is represented in computer systems in binary form
(e) understand and produce simple logic diagrams using the operations NOT, AND and OR
(f) produce a truth table from a given logic diagram.
(a, b and c are points that relate to the CPU)
![Page 6: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/6.jpg)
AND OR NOT For A AND B to be true, then A must be true and B must be true
For example,
“It is true that Cambridge United won last week and there was 5 cm of snow on Friday” is only true if both are true.
For A OR B to be true then at least one of A and B must be true
“It is true that Cambridge United won last week OR there was 5 cm of snow on Friday” is true if only one of the individual statements is true
NOT A is always the opposite of A. So if A is true, NOT A is false.
For example, “It is not raining” is true if “It is raining” is false
![Page 7: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/7.jpg)
The NOT gate (inverter)
Note there is 1 input, A, and 1 output (often called Q)
We can also represent this mathematically as
Diagrammatic representation of a NOT gate
Athe bar notation represents logical NOT
A
![Page 8: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/8.jpg)
The AND gate
Note there are 2 inputs, A and B, and 1 output Q
We can also represent this mathematically as
A . B(the dot notation represents logical AND)
Diagrammatic representation of an AND gate
![Page 9: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/9.jpg)
The OR gate
Note there are 2 inputs, A and B, and 1 output Q
We can also represent this mathematically as
A + B(the + notation represents logical OR)
Diagrammatic representation of an OR gate
![Page 10: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/10.jpg)
Truth Tables
A truth table shows the output values for all the different input combinations.
![Page 11: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/11.jpg)
TaskComplete the truth tables on the sheet
As a minimum, do AND, NOT and OR
Extension – try the remaining ones
![Page 12: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/12.jpg)
Using Logic.Ly
Go to http://logic.ly/ and select Try Online
Close the demo box offered
Drag the gates and inputs and outputs to the main window
Try to build and AND, NOT and an OR circuit
![Page 13: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/13.jpg)
Try these circuits: Circuit 1
![Page 14: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/14.jpg)
Circuit 1
0
1
1
1
1
0
0
0
![Page 15: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/15.jpg)
Circuit 2
![Page 16: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/16.jpg)
Circuit 2
0
0
0
1
1
1
1
0
![Page 17: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/17.jpg)
Circuit 3
![Page 18: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/18.jpg)
Circuit 3
0
1
1
1
1
0
1
0
0
0
1
0
![Page 19: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/19.jpg)
Circuit 40
00
0
0
0
0
0
0
0
0
0
1
1
1
1
0
00
1
0
0
0
1
0
0
0
1
0
0
0
1
0
00
1
0
0
0
1
0
0
0
1
1
1
1
1
![Page 20: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/20.jpg)
Circuit 5
1
1
0
0
1
1
0
0
0
0
0
0
0
0
1
1
1
1
0
1
1
1
0
1
1
1
0
1
1
1
1
1
0
0
1
0
0
0
0
0
![Page 21: Teaching Computing to GCSE Level with Python Session 3.](https://reader036.fdocuments.net/reader036/viewer/2022081603/56649f495503460f94c6b329/html5/thumbnails/21.jpg)
Circuit 6
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
1
1
0
0
1
1
0
0
0
0
0
0
0
0
1
1
0
1
0
0
0
1
0
0
0
1
0
0
0
1
1
1
1
0
1
1
1
0
0
0