Worksheets › Class 9 › Binary, Data and Logic › Cheat sheet
Class 9 Binary, Data and Logic: cheat sheet
CBSE Computational Thinking and AI. Computers store everything as bits. Binary numbers, data sizes, ASCII codes and the logic of AND, OR and NOT are the base of all computing.
Key ideas
- A bit is a 0 or a 1; 8 bits make a byte; 1 KB is 1,024 bytes and 1 MB is 1,024 KB.
- In binary each place is double the one to its right; turn decimal into binary by dividing by 2 and reading the remainders upwards.
- An image needs width × height × bits per pixel, divided by 8 to get bytes.
- In ASCII each character has a number: A = 65, B = 66, up to Z = 90; one character takes 1 byte.
- With b bits there are 2ᵇ different codes.
- A truth table lists every row of inputs: 2 inputs give 4 rows, 3 inputs give 8.
Remember
| Binary | 45 = 32 + 8 + 4 + 1 = 101101₂ |
| Sizes | 1 byte = 8 bits; 1 KB = 1,024 bytes; 1 MB = 1,024 KB |
| Image size | 100 × 80 pixels × 8 bits ÷ 8 = 8,000 bytes |
| AND; OR; NOT | True only if both; True if at least one; flips the value |
| Order of work | brackets and NOT first, then AND, then OR |
| Fewest bits for m items | the smallest b with 2ᵇ ≥ m: 200 items → 8 bits |
Watch out
- Using 1,000 instead of 1,024 bytes in a KB.
- Forgetting to divide bits by 8 to get bytes.
- Writing the binary remainders top to bottom instead of bottom to top.
Worked example
A = True, B = True, C = False. Is (A AND B) OR (NOT C) True or False?
Working: work out the brackets and NOT first, then AND, then OR
Answer: True
Practise Binary, Data and Logic
Revise with this page, then practise: every Binary, Data and Logic sheet in the app is new, with an answer key and working.
Coming soon for Android and iPhone.