In simple terms
A friendly intro before the formal notes — no formulas yet.
The Computer's Secret Code
Computers fundamentally operate with 'on' and 'off' electrical signals, which we represent as 1s and 0s (binary). This lesson decodes how these simple bits are cleverly combined to represent everything we see and use on a screen.
Imagine you only have a light switch. To communicate, you could create a code: 'on-off-on' means 'A', 'off-off-on' means 'B'. This is exactly what computers do. A sequence of 1s and 0s (a byte) is a pattern that can represent a number, a letter, or a pixel's colour.
- 1
The Bit is Basic: Start with the smallest unit, a single binary digit (0 or 1), representing an 'off' or 'on' state.
- 2
Bytes for Building: Group 8 bits into a byte. A byte can hold 2^8 = 256 distinct patterns, perfect for representing characters or small integers.
- 3
Handling Negatives: Use the two's complement system to represent both positive and negative integers within a fixed number of bits, like an 8-bit byte.
- 4
Encoding Everything Else: Map characters to binary numbers using standards like ASCII and Unicode. Represent colours by storing the binary values for Red, Green, and Blue components (RGB).
Explore the concept
Use the live diagram and synced steps — play it or tap a step card to walk through.
Key formulas
Tap any symbol to reveal exactly what it means and its units.
Tap a symbol — great for exam definitions
Full topic notes
Formal explanation with the rigour you need for the exam.
The Building Blocks: Bits and Bytes
The smallest unit of data in a computer is a bit (binary digit), which can hold a value of either 0 or 1. While a single bit isn't very useful on its own, grouping them together allows us to represent more complex information. The most common grouping is a byte, which consists of 8 bits.
1 bit can represent values (0 or 1).
8 bits = 1 byte. A byte can represent different values (from 00000000 to 11111111).
The rightmost bit is the Least Significant Bit (LSB), and the leftmost bit is the Most Significant Bit (MSB).
Representing Integers: Two's Complement
Representing positive integers is straightforward binary conversion. However, to represent negative integers, computers commonly use a system called two's complement. In an n-bit two's complement system, the Most Significant Bit (MSB) acts as a sign indicator. If the MSB is 0, the number is positive. If it is 1, the number is negative. This system is efficient because it allows arithmetic operations (like addition and subtraction) to be performed with the same hardware, regardless of the numbers' signs.
The range of integers that can be represented by an n-bit two's complement number is from to .
Representing Characters and Colours
Binary is not just for numbers. By agreeing on a standard mapping, we can represent characters. ASCII (American Standard Code for Information Interchange) is an early 7-bit standard, representing 128 characters. Unicode is a modern, more extensive standard that aims to represent every character from every language, using variable-width encodings like UTF-8. For colours, the RGB model is common. It represents a colour by specifying the intensity of its Red, Green, and Blue components. In 24-bit 'true colour', each of the three components is assigned 8 bits, allowing for levels of intensity per component.
ASCII: Uses 7 or 8 bits per character. Standard ASCII (7-bit) can represent 128 characters (enough for English letters, numbers, and symbols).
Unicode: A superset of ASCII. It can represent over 140,000 characters using up to 32 bits per character, covering most world languages and symbols (e.g., emojis).
24-bit RGB Colour: Uses 8 bits for Red, 8 for Green, and 8 for Blue. This allows for million different colours.
Data Storage Calculations
Understanding binary representation is key to calculating data storage requirements. When discussing file sizes and memory capacity, we use units like kilobytes, megabytes, and gigabytes. It is crucial to distinguish between the SI decimal prefixes (powers of 1000) and the IEC binary prefixes (powers of 1024). In exam questions, the IB typically follows the SI convention where 1 kilobyte (KB) = 1000 bytes. Always check the question for the specific definition to use.
Worked examples
See the formulas applied — reveal one step at a time, like the exam.
Represent the decimal number -42 as an 8-bit two's complement binary number.
- 1
Find the binary for the positive equivalent (+42):
An uncompressed image has a resolution of 800 x 600 pixels. Each pixel is stored using a 24-bit RGB colour depth. Calculate the size of the image file in Megabytes (MB), assuming 1 MB = 1,000,000 bytes.
- 1
Calculate the total number of pixels:
How it all connects
The big idea sits in the middle — tap a linked idea to explore the link.
Tap a linked idea to see how it connects back to the main topic — that connection is what examiners reward.
Glossary
Try to recall each definition before you reveal it.
Quick check
Answer in your head first — then tap to check. No pressure.
Revision flashcards
Flip the card. Test yourself before the exam.
Bit
The smallest unit of data in a computer, representing a single binary value of either 0 or 1. Short for 'binary digit'.
Key takeaways
Review these before you close the topic — retrieval beats re-reading.
- ✓
1 bit can represent values (0 or 1).
- ✓
8 bits = 1 byte. A byte can represent different values (from 00000000 to 11111111).
- ✓
The rightmost bit is the Least Significant Bit (LSB), and the leftmost bit is the Most Significant Bit (MSB).
Practice — then mark it
The whole point: a real Cambridge question, marked mark-by-mark.
Practice Questions on Binary Representation
Practice Questions on Binary Representation
Extra simulations & links
PhET, GeoGebra and other curated tools — open in a new tab.
Frequently asked
Checkpoint
One marked question is worth ten re-reads — close the loop before you move on.
Reading it isn’t knowing it — prove it.
Before you move on: do Practice Questions on Binary Representation on paper, snap a photo, and get examiner-style feedback on exactly where you win and lose marks.