Loading…
Loading…
Loading…
AQA GCSE Computer Science · 8525
AQA 8525 Check the specification (PDF) (opens in a new tab)
A number can be written in different number systems without changing its value. , also called , is the familiar base-10 system: it uses the digits 0–9, with columns for units, tens, hundreds and so on.
Binary is a base-2 number system. It uses only two digits, 0 and 1. Each binary digit is called a bit, so an 8-bit binary number contains eight digits.
The position of each digit determines its place value. In decimal, place values become ten times larger as you move left. In binary, they become twice as large. Starting with 1 on the right, the eight binary place values are:
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|
A 1 means that the column's value contributes to the number. A 0 means that it does not. The whole number is the sum of the selected place values.
For example, 00001101 has 1s in the 8, 4 and 1 columns. Its decimal value is therefore . The zeros on the left do not change its value; they make it an eight-digit representation.
To represent a decimal whole number in binary, choose the place values that add up to it. Work from the largest column, 128, towards the smallest, 1, keeping track of the amount still left to represent: the remainder.
For each column:
Once the remainder reaches zero, put 0 in every remaining column.
Consider the decimal number 84. The 128 column is too large, but 64 fits, leaving . The 32 column is too large for 20, but 16 fits, leaving 4. The 8 column is too large for 4, and the 4 column is an exact match. That leaves zero, so the final two columns contain 0.
| Column value | Remainder before checking | Binary digit | Remainder afterwards |
|---|---|---|---|
| 128 | 84 | 0 | 84 |
| 64 | 84 | 1 | 20 |
| 32 | 20 | 0 | 20 |
| 16 | 20 | 1 | 4 |
| 8 | 4 | 0 | 4 |
| 4 | 4 | 1 | 0 |
| 2 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 |
Reading the digits from top to bottom gives 01010100. Written beneath their place values, they look like this:
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
| Binary digit | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 |
To find the decimal value of a binary number, add only the place values whose digits are 1. This also gives you a way to check a decimal-to-binary conversion.
For 01010100, the selected columns are 64, 16 and 4:
The total matches the starting number, so the conversion is correct. A binary 1 does not always mean one unit: in the 64 column, it contributes 64.
For these conversions, the decimal values run from 0 to 255.
The smallest value is 00000000: no columns contribute, so the total is 0. The largest is 11111111: every column contributes, giving:
An exact place value uses just one 1. For example, decimal 128 is 10000000. Any smaller value has a 0 in the 128 column, but that zero must still be included when writing an 8-bit answer.
Binary uses 0 and 1. Eight bits have place values, left to right:
128, 64, 32, 16, 8, 4, 2, 1
A 1 includes the column's value; a 0 excludes it.
Work left to right. If the column value is less than or equal to the remainder, write 1 and subtract it. Otherwise, write 0. Fill remaining columns with zeros when the remainder reaches zero.
Add the place values of all columns containing 1. Use this to check your conversion.
0000000011111111Write all eight digits when an 8-bit answer is requested, adding leading zeros on the left if necessary.
Use a column when its value is less than or equal to the remainder. An exact match needs a 1 and leaves a remainder of zero.
Check a conversion by adding the place values beneath every 1. Columns containing 0 contribute nothing.
Keep the place values in the correct order: 128, 64, 32, 16, 8, 4, 2, 1.
It can see this note and what your specification asks for.
Answers are free with an account.
1 free note left this week
Get more free notesYour answer sets when this note comes back for review, or marks it complete.
Was this note helpful?
Log in to tell us whether it helped, or to report a problem.
Last updated
Binary
A base-2 number system that uses only the digits 0 and 1.
Decimal
A base-10 number system that uses the digits 0–9; also called denary.
Bit
A binary digit, whose value is either 0 or 1.
Place value
The value assigned to a digit's position within a number. In binary, place values double with each position to the left.
Put your knowledge into practice — try past paper questions for Computer Science
Binary
A base-2 number system that uses only the digits 0 and 1.
Decimal
A base-10 number system that uses the digits 0–9; also called denary.
Bit
A binary digit, whose value is either 0 or 1.
Place value
The value assigned to a digit's position within a number. In binary, place values double with each position to the left.