How do you convert between denary and binary, add binary numbers and use binary shifts?
Converting between denary and binary (up to and including 8 bits), binary addition and the detection of overflow, and binary shifts and their effect.
An OCR J277 1.2.4 answer on converting between denary and binary up to 8 bits, adding binary numbers and detecting overflow, and binary shifts and their effect on a value.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
OCR wants you to convert between denary and binary up to 8 bits, add two binary numbers and say whether the result overflows, and perform binary shifts and state their effect. This is the core number work of Paper 1, so the methods must be quick and accurate, and you should always show working.
Place values and converting
Binary addition and overflow
Binary shifts
A left shift can cause data to be lost if a 1 is pushed off the left end (an overflow), and a right shift loses precision if a 1 falls off the right end (the remainder is discarded, so it is integer division). Shifts are used because they are a very fast way for the processor to multiply or divide by powers of two.
Try this
Q1. Convert the denary number 93 to 8-bit binary. [1 mark]
- Cue. , so .
Q2. Add the 4-bit numbers and , and state whether an overflow occurs in 4 bits. [2 marks]
- Cue. (6 + 5 = 11); it fits in 4 bits, so no overflow.
Q3. A number is left-shifted by 2 places. By what value is it multiplied? [1 mark]
- Cue. .
Exam-style practice questions
Practice questions written in the style of OCR exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
OCR 20213 marksConvert the denary number 178 into an 8-bit binary number. Show your working.Show worked answer →
Use the 8-bit place values . Work from the largest, subtracting where the value fits.
, so the 128 column is 1. , so the 32 column is 1 (64 does not fit). , so the 16 column is 1. , so the 2 column is 1. The remaining columns are 0.
Result: . Check: .
Markers reward the correct method (place values and subtraction) and the correct answer; a working shown lets you gain method marks even with a single slip.
OCR 20224 marksAdd the two 8-bit binary numbers 01001101 and 01100110. Give your answer and state whether an overflow has occurred, explaining your reasoning.Show worked answer →
Add column by column from the right, carrying where the total is 2 or 3.
.
Check in denary: and ; , and , so the addition is correct.
Overflow: the result fits in 8 bits, so there is no overflow (no carry out of the 128 column into a 9th bit). Overflow occurs only when the result needs more bits than are available, that is when there is a carry out of the leftmost (most significant) column.
Markers reward the correct sum, the correct overflow judgement, and a reason (carry out of the most significant bit means the result will not fit in 8 bits).
Related dot points
- Why data must be represented in binary, the units of information (bit, nibble, byte, kB, MB, GB, TB, PB) and how to convert between them.
An OCR J277 1.2.3 answer on why computers use binary, the units of information from bit and nibble up to petabyte, and how to convert between units of data capacity.
- Why hexadecimal is used to represent numbers, and how to convert between binary, denary and hexadecimal.
An OCR J277 1.2.4 answer on why hexadecimal is used in computing and how to convert between binary, denary and hexadecimal, with worked conversions in both directions.
- Representing characters with ASCII and Unicode; representing images with pixels, colour depth, resolution and metadata; representing sound with sample rate, sample resolution and bit rate; and the effect on file size and quality.
An OCR J277 1.2.4 answer on representing characters (ASCII, Unicode), images (pixels, colour depth, resolution, metadata) and sound (sample rate, sample resolution, bit rate), and the effect of each on file size and quality.
- The need for primary storage, the purpose and characteristics of RAM and ROM, the differences between them, and the need for virtual memory.
An OCR J277 1.2.1 answer on the need for primary storage, the purpose and characteristics of RAM and ROM, the differences between them, and why virtual memory is needed.
- Boolean logic: the operators AND, OR and NOT, applying them to expressions, and constructing truth tables for simple logic statements including combinations of operators.
An OCR J277 2.4.1 answer on Boolean logic: the operators AND, OR and NOT, applying them to expressions, and constructing truth tables for simple logic statements and combinations of operators.
Sources & how we know this
- OCR GCSE (9-1) Computer Science (J277) specification — OCR (2020)