Binary
8 bits = 1 byte
A GIF is made up of 256 colours - 11111111 is 255 - add a 0 to make 256
Logic gates and Truth tables
Your task:
Work out the table using A+(A.B)=Q or... A AND (A or B) = Q
A | B | A or B | Q |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 1 | 1 |
1 | 1 | 1 | 1 |
Exam example:
Steps...
1. First create a D
2. A OR B = D
3. D AND C = Q
A | B | C | D | Q |
---|---|---|---|---|
0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 | 0 |
0 | 1 | 0 | 1 | 0 |
0 | 1 | 1 | 1 | 1 |
1 | 0 | 0 | 1 | 0 |
1 | 0 | 1 | 1 | 1 |
1 | 1 | 0 | 1 | 0 |
1 | 1 | 1 | 1 | 1 |
Adding binary
See workings out below:
Hexidecimal
BIN 2
DEC 10
OCT 8
HEX 16
1
2
3
4
5
6
7
8
9
A 10
B 11
C 12
D 13
E 14
F 15
Converting Binary to Hexidecimal
Break it into nibbles!!
1111 1010
15 10
FA
Take a look at resources to help teach binary:
Binary represented through images
Binary represented through sound
Python
Take a look at Python.org for built-in functions
float : a data type, usually associated with decimal numbers
def functionName() :
Follow up.... Print KS4 Python Common Errors document
for i in range (0, 5) #i is the variable we define
other examples:
for letter in string
for line in file
for number in range