Binary for Integers & Conversions (SQA National 5 Computing Science): Revision Note
Exam code: X816 75
Binary to represent positive integers
Why do computers use binary?
Computers can only understand two electrical states, on and off
These states are represented by 1 and 0 in the binary number system (base 2)
All data in a computer is converted into binary before it can be stored or processed
Binary is used because it is reliable and efficient, each switch, wire or transistor only needs to handle two possible states
Examples
1 = on (electrical current present)
0 = off (no electrical current)
What is denary?
Denary (also called decimal) is a number system made up of 10 digits (0–9)
It is a base-10 system
Each digit has a value based on powers of 10
Column heading | 1000 | 100 | 10 | 1 |
|---|---|---|---|---|
Denary number 3268 | 3 | 2 | 6 | 8 |
Humans use the denary system for counting, measuring and performing calculations

What is binary?
Binary is a number system made up of two digits (1 and 0)
It is a base-2 system
Each digit has a value based on powers of 2
Column heading | 8 | 4 | 2 | 1 |
|---|---|---|---|---|
Binary number 1100 |
|
|
|
|
Each extra binary digit (bit) doubles the maximum number that can be represented

8 bit binary column headings
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
Binary to denary conversion
To convert binary to denary
Write the column headings for the number of bits
Add together all the headings with a 1 underneath
Example 1 (6 bits)
Convert binary
101101to denary
32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|
|
|
|
|
|
|
(32 + 8 + 4 + 1) = 45
Binary
101101is 45 in denaryExample 2 (8 bits)
Convert binary
01100011to denary
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
(64 + 32 + 2 + 1) = 99
Binary
01100011is 99 in denary
Examiner Tips and Tricks
If a binary number ends in 1, the denary answer must be odd
Check that your answer makes sense, a large binary number should give a larger denary result
You only need to convert positive integers for SQA National 5
Denary to binary conversion
It is important to know how to convert from denary to binary
Follow these steps
Write out the binary column headings for 8 bits (128 64 32 16 8 4 2 1)
Find the largest heading smaller than or equal to the denary number
Subtract it, write 1 in that column, and repeat until the remainder is 0
Fill unused columns with 0
Example 1
Convert the denary number 60 to binary
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
Denary 60 is
00111100in 8-bit binaryExample 2
Convert the denary number 105 to binary
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
Denary 105 is
01101001in 8-bit binary
Examiner Tips and Tricks
Always check how many bits the question asks for
If it says “8-bit”, pad your answer with leading zeros
Each binary place value doubles as you move left
Use subtraction or division by 2, whichever you prefer
Worked Example
(i) Denary to Binary Conversion (8-bit)
A program records a player's score of 79 points.
Convert the denary number 79 into its standard 8-bit binary representation.
[1]
(ii) Binary to Denary Conversion
Convert the following 8-bit binary pattern back into its positive integer (denary) value.
10110010
[1]
Answers
(i)
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
(ii)
Denary Value: 178 (Calculation: 128+32+16+2=178)
Unlock more, it's free!
Did this page help you?