You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Understanding number systems is essential for OCR J277 Section 2.6 (Data Representation). Computers store and process all data using binary (base-2), but humans normally use denary (base-10, also called decimal). You must be able to convert fluently between these two systems.
By the end of this lesson you should be able to explain how binary and denary place value work and convert numbers between the two systems. This develops AO1 (knowledge and understanding of how computers represent numbers) and AO2 (applying that knowledge to carry out binary-to-denary and denary-to-binary conversions).
The denary number system uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Each position in a denary number represents a power of 10.
| Position | Thousands (103) | Hundreds (102) | Tens (101) | Units (100) |
|---|---|---|---|---|
| Example: 4527 | 4 | 5 | 2 | 7 |
| Value | 4000 | 500 | 20 | 7 |
4527 = (4 x 1000) + (5 x 100) + (2 x 10) + (7 x 1) = 4527
This is the system you use every day, so it feels natural. Computers, however, use binary because their electronic circuits can only distinguish between two states: on (1) and off (0).
The binary number system uses only two digits: 0 and 1. Each position represents a power of 2. A single binary digit is called a bit.
| Position | 128 (27) | 64 (26) | 32 (25) | 16 (24) | 8 (23) | 4 (22) | 2 (21) | 1 (20) |
|---|---|---|---|---|---|---|---|---|
| Example: 10110011 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 |
To convert to denary: 128 + 32 + 16 + 2 + 1 = 179
flowchart LR
Denary((Denary - base 10)) -->|successive division by 2| R[Read remainders bottom to top]
Denary -->|place value subtraction| P[128 64 32 16 8 4 2 1]
R --> Binary((Binary - base 2))
P --> Binary
Binary -->|sum place values where bit = 1| Denary
Binary --- Hardware[Maps to transistor on/off states]
Use the successive division method (divide by 2 and record remainders):
Example: Convert 156 to binary
| Division | Quotient | Remainder |
|---|---|---|
| 156 / 2 | 78 | 0 |
| 78 / 2 | 39 | 0 |
| 39 / 2 | 19 | 1 |
| 19 / 2 | 9 | 1 |
| 9 / 2 | 4 | 1 |
| 4 / 2 | 2 | 0 |
| 2 / 2 | 1 | 0 |
| 1 / 2 | 0 | 1 |
Read remainders from bottom to top: 156 = 10011100
Alternatively, use the place value method: find the largest power of 2 that fits and subtract:
OCR Exam Tip: The place value method is usually quicker in the exam and less prone to error. Always double-check by converting your binary answer back to denary.
Write out the place values and add up the columns where there is a 1.
Example: Convert 11010110 to denary
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 |
128 + 64 + 16 + 4 + 2 = 214
| Reason | Explanation |
|---|---|
| Electronic circuits | Transistors have two states: on (1) and off (0) |
| Reliability | It is easy to distinguish between two voltage levels, reducing errors |
| Simplicity | Binary arithmetic is simpler to implement in hardware |
| Boolean logic | Binary maps directly to true/false logic operations |
| Term | Definition |
|---|---|
| Bit | A single binary digit (0 or 1) |
| Nibble | 4 bits |
| Byte | 8 bits |
| Denary | Base-10 number system (0-9) |
| Binary | Base-2 number system (0, 1) |
| Place value | The value of a digit based on its position |
OCR Exam Tip: The maximum value for an n-bit binary number is 2n−1. For 8 bits, this is 28−1=255. You should memorise this.
This worked example walks through the full denary-to-binary-to-denary cycle so you can verify your answer in the exam.
Step 1: Denary to binary using the place value method.
Write the place values: 128, 64, 32, 16, 8, 4, 2, 1.
Result: 10101101
Step 2: Binary to denary check.
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 |
128 + 32 + 8 + 4 + 1 = 173. The conversion is verified.
Mini-challenge: Convert 218 to 8-bit binary using the same method, then check by converting back. (Answer: 11011010 = 128 + 64 + 16 + 8 + 2 = 218.)
The single most important idea in this whole topic is place value. Once you truly understand it, every conversion becomes a matter of adding or splitting numbers rather than memorising a recipe. In any number system, the value of a digit depends on two things: the digit itself and the column it sits in. Each column is worth a fixed power of the base. In denary the base is ten, so the columns going left from the decimal point are worth 1, 10, 100, 1000 and so on. In binary the base is two, so the columns are worth 1, 2, 4, 8, 16, 32, 64, 128 and beyond.
Written as powers, the binary columns are the following. The rightmost bit is worth 20=1, then 21=2, then 22=4, then 23=8, and so on up to 27=128 for an eight-bit number. This is why an eight-bit number can be at most 28−1=255: if every one of the eight bits is set to 1, the total is 128+64+32+16+8+4+2+1=255.
A helpful way to picture this is that each time you move one column to the left, the value doubles; each time you move one column to the right, the value halves. This doubling pattern is worth learning by heart because it appears everywhere in computing: memory sizes, colour depths, sound bit depths, and network addresses are all built from powers of two.
OCR Exam Tip: If you can recite the eight place values (1, 2, 4, 8, 16, 32, 64, 128) instantly and in both directions, you will convert far faster and make fewer slips. Write them along the top of your working before you start any conversion.
Two pieces of vocabulary appear often in exam questions and mark schemes. The most significant bit (MSB) is the leftmost bit — it carries the largest place value, which is 128 in an eight-bit number. The least significant bit (LSB) is the rightmost bit — it carries the smallest place value, which is 1.
The names make sense once you see their effect. Flipping the most significant bit from 0 to 1 changes the value by 128, which is a large jump. Flipping the least significant bit changes the value by only 1, the smallest possible change. This is also why the least significant bit tells you instantly whether a binary number is odd or even: if the rightmost bit is 1 the number is odd; if it is 0 the number is even. For example, 10110011 ends in a 1, so it must be odd (it is 179), whereas 10110010 ends in a 0, so it must be even (it is 178).
Understanding the MSB and LSB will help later when you meet binary shifts, overflow, and colour channels, because those topics all describe what happens at particular ends of a binary number.
Let us convert the denary number 92 to binary and back, explaining the reasoning at every step so that the method becomes second nature.
Convert 92 to binary using the place value method.
Write the eight place values: 128, 64, 32, 16, 8, 4, 2, 1. Now ask, for each column from the left, "does this value fit into what remains?"
Reading the columns left to right gives 01011100.
Check by converting 01011100 back to denary.
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 |
Adding the columns that contain a 1: 64+16+8+4=92. The answer is confirmed.
Notice how the running remainder never went negative and reached exactly zero at the end. If your remainder ever goes negative, you have wrongly placed a 1 where a 0 should be; if it is not zero after the units column, you have missed a 1 somewhere. These two self-checks catch almost every conversion mistake.
Common misconception: A very common error is reading a binary number as if it were denary — for example, seeing 101 and thinking it means "one hundred and one". In binary, 101 means 4+0+1=5. The digits look the same as denary digits, but the columns are worth powers of two, not powers of ten, so you must always add up place values rather than reading the number aloud.
Common misconception: Students sometimes drop leading zeros and then miscount the columns. In an eight-bit representation, the number 5 must be written as 00000101, not 101. The leading zeros are not decoration — they keep each bit in its correct column so the place values line up. Whenever a question specifies "8-bit binary", always write all eight digits.
Common misconception: Another frequent slip is thinking the largest value in eight bits is 256. In fact the largest value is 28−1=255, because the count of different values is 256 (from 0 up to 255 inclusive), but the highest single value is 255. This "off-by-one" between the number of combinations and the maximum value is one of the most heavily tested ideas in the whole topic.
The following is a specimen question modelled on the OCR J277 paper format. It is not a real past-paper question.
Question: A temperature sensor stores readings as 8-bit unsigned binary numbers.
(a) Convert the denary reading 148 into 8-bit binary. (2 marks)
(b) Convert the stored binary value 00111111 back into denary. (2 marks)
(c) State the largest denary value the sensor can store in 8 bits, and explain your answer. (2 marks)
Mark scheme (AO1 recall and AO2 application):
Part (a): 148=128+16+4, giving 10010100 (1 mark for correct method/working, 1 mark for the correct final answer). Accept a fully correct answer with no working for both marks; award only the method mark if a single-bit slip is present but the method is clearly shown.
Part (b): the set bits are 32, 16, 8, 4, 2, 1, so 32+16+8+4+2+1=63 (1 mark for adding the correct place values, 1 mark for the correct total of 63).
Part (c): the largest value is 255 (1 mark), because with 8 bits all set to 1 the total is 128+64+32+16+8+4+2+1=255, which equals 28−1 (1 mark for a correct justification referring to all bits set or to 2n−1).
OCR Exam Tip: In part (c), a bare answer of "255" earns the first mark, but the second mark needs a reason. The quickest correct justification is "all eight bits set to 1" or "28−1". Learn to give the value and the reason, because two-mark "state and explain" items always split the marks this way.
Exam-style question (5 marks): Convert the denary number 165 into 8-bit binary. Show your working, and explain why a computer uses binary rather than denary to store this value.
165 in binary is 10100101. Computers use binary because they only understand 0 and 1.
Examiner comment: The conversion is correct but no working is shown, so method marks are at risk if the answer were wrong. The explanation is true but very thin — it does not link to hardware.
165 - 128 = 37, so 1 in the 128 column. 37 - 32 = 5, so 1 in the 32 column. 5 - 4 = 1, so 1 in the 4 column. 1 - 1 = 0, so 1 in the 1 column. Answer: 10100101. Computers use binary because electronic circuits have two states (on and off), which match the digits 1 and 0.
Examiner comment: Working is shown clearly and the link to two states (on/off) is made. Could be improved by mentioning that two distinct voltage levels are easier to distinguish reliably.
Using the place value method: 165 = 128 + 32 + 4 + 1, giving the columns 1, 0, 1, 0, 0, 1, 0, 1. Final answer: 10100101. Verification: 128 + 32 + 4 + 1 = 165. Computers use binary because transistors operate as switches with two stable states (on and off, represented as high/low voltage). Two states can be distinguished reliably with minimal error, which makes binary arithmetic both simple to implement in hardware and resistant to noise. Binary also maps directly onto Boolean logic (true/false), which underpins all processor instructions.
Examiner comment: Full marks. The candidate shows correct working, verifies the answer, and gives a precise hardware-level explanation that links transistors, voltage, reliability, and Boolean logic.
This content is aligned with OCR GCSE Computer Science (J277) specification section 1.2 Memory and storage (data representation). For the most accurate and up-to-date information, please refer to the official OCR specification document.