Upload
zahina
View
45
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Teaching Computing to GCSE Level with Python. Session 3. Your second starter !. 1. Convert these binary numbers to denary: 0 1 0 1 0 0 1 01 0 1 1 0 1 1 0 2. Convert the same numbers to hex 3. Convert these hex numbers to binary A 34 F2 42 9 4. Convert these binary numbers to hex - PowerPoint PPT Presentation
Citation preview
Teaching Computing to GCSE Level with PythonSession 3
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 02. Convert the same numbers to hex3. Convert these hex numbers to binaryA 3 4 F 2 4 2 94. Convert these binary numbers to hex0 1 1 1 0 0 0 1 1 0 1 1 0 1 0 15. What is the largest denary number you can express in 9 bits?6. How many different values can you show using 9 bits?
Topics for todayTheory
Binary logic: AND, OR, NOT Truth tables Logic Gates www.logic.ly
Programming IF Statements
Binary logicGCSE Computing link to specificationRecap on binary numbersAND OR NOTTruth tablesLogic diagramsLogic.ly
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)
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
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
The AND gate
Note there are 2 inputs, A and B, and 1 output Q
We can also represent this mathematically asA . B
(the dot notation represents logical AND)
Diagrammatic representation of an AND gate
The OR gate
Note there are 2 inputs, A and B, and 1 output Q
We can also represent this mathematically asA + B
(the + notation represents logical OR)
Diagrammatic representation of an OR gate
Truth Tables
A truth table shows the output values for all the different input combinations.
TaskComplete the truth tables on the sheetAs a minimum, do AND, NOT and ORExtension – try the remaining ones
Using Logic.Ly
Go to http://logic.ly/ and select Try OnlineClose the demo box offeredDrag the gates and inputs and outputs to the main
windowTry to build and AND, NOT and an OR circuit
Try these circuits: Circuit 1
Circuit 1
0111
1000
Circuit 2
Circuit 2
0001
1110
Circuit 3
Circuit 3
0111
1010
0010
Circuit 40000000000001111
0001000100010001
0001000100011111
Circuit 5
11001100
00000011
11011101
11011111
00100000
Circuit 6
00001111
00110011
01010101
11001100
00000011
01000100
01000111
10111000