Term 3 round-up
Answers are for parents and teachers.
1
A black-and-white picture is 15 pixels across and 6 pixels down. How many bits does it need? How many bits would it need with a colour depth of 3, and how many different colours could it then hold?
15 × 6 × 1 = 90 bits. With a colour depth of 3 it needs 15 × 6 × 3 = 270 bits and can hold 8 colours (2 × 2 × 2).
2
Change these binary numbers into ordinary numbers: (a) 00010111 (b) 00101010.
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 |
| 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
(a) 16 + 4 + 2 + 1 = 23. (b) 32 + 8 + 2 = 42.
3
Complete the truth table for Z = A OR NOT B.
| A | B | NOT B | Z |
|---|---|---|---|
| 0 | 0 | ? | ? |
| 0 | 1 | ? | ? |
| 1 | 0 | ? | ? |
| 1 | 1 | ? | ? |
A = 0, B = 0: NOT B = 1, Z = 1; A = 0, B = 1: NOT B = 0, Z = 0; A = 1, B = 0: NOT B = 1, Z = 1; A = 1, B = 1: NOT B = 0, Z = 1.
4
Write the code rows for the letter E on the 5 × 5 lights. Use 9 for a light that is on.
Image("99999:90000:99990:90000:99999")
5
Look back at the year. Write three things from this year that you can now do, with one sentence about each. Write one question about something that you would like to understand better.
Any three honest answers are fine, for example: ‘I can use int() to cast an input.’ ‘I can find the owner of a web address.’ ‘I can write a picture on the lights as five rows of 0 and 9.’ A good question names a particular idea, such as why a boundary test matters.