OCR A-Level Computer Science H446
Processors: Structure, Performance and Types
Input, Output and Storage
Systems Software
Applications Generation
Software Development
Types of Programming Language
Exchanging Data
Networks
Web Technologies
Data Types and Number Representation
Data Structures
Boolean Algebra
Legal, Moral, Cultural and Ethical Issues
Elements of Computational Thinking
Problem Solving and Programming
Algorithms
Data Types and Number Representation
Binary, hexadecimal and denary conversion
- 3 things to know
- Component 01
Overview
Recall questions on why computers use binary, place values and the number of values in n bits, converting between binary, denary and hexadecimal, the nibble shortcut, hexadecimal colour codes, and why programmers use hexadecimal.
What you need to know
Answer each one before you reveal it.
Why does hexadecimal need the letters A to F?
Convert the hexadecimal number 7A3 to binary.
Questions from this subtopic
Each one with the model answer underneath.
- 1
Why does a computer represent numbers in binary rather than denary?
Model answer
Because its circuits are made of switches with two stable states, on and off, high voltage and low voltage. Two states are easy to build reliably and easy to tell apart even when the signal is slightly degraded. Ten distinguishable voltage levels would be far harder to manufacture and far more error-prone, so all data is coded as patterns of two symbols, 0 and 1.
- 2
What are the place values of an eight-bit binary number, reading from the left?
Model answer
128, 64, 32, 16, 8, 4, 2, 1. Each place is worth twice the one to its right, and the rightmost place is worth 1, which is 2 to the power 0.
- 3
How many different values can be represented in n bits, and what is the largest unsigned value?
Model answer
There are 2 to the power n different bit patterns, and since one of them represents zero, the largest unsigned value is 2 to the power n minus 1. In 8 bits that is 256 patterns and a maximum of 255; in 16 bits it is 65536 patterns and a maximum of 65535.
- 4
Convert the binary number 11001010 to denary.
Model answer
202. Write the place values above the bits: 128, 64, 32, 16, 8, 4, 2, 1. The bits that are 1 sit under 128, 64, 8 and 2. Adding those gives 128 + 64 + 8 + 2 = 202.
- 5
Convert the denary number 156 to eight-bit binary using the place value method.
Model answer
10011100. Work left to right through the place values. 128 fits into 156, leaving 28, so write 1. 64 does not fit into 28, so 0. 32 does not fit, so 0. 16 fits, leaving 12, so 1. 8 fits, leaving 4, so 1. 4 fits, leaving 0, so 1. Then 2 and 1 are both 0. That gives 1001 1100, and checking, 128 + 16 + 8 + 4 = 156.
- 6
Show how repeated division by 2 converts 156 to binary, and say why the digits come out backwards.
Model answer
Divide repeatedly and record the remainders: 156 / 2 = 78 r 0, 78 / 2 = 39 r 0, 39 / 2 = 19 r 1, 19 / 2 = 9 r 1, 9 / 2 = 4 r 1, 4 / 2 = 2 r 0, 2 / 2 = 1 r 0, 1 / 2 = 0 r 1. Reading the remainders from the bottom upwards gives 10011100. They come out backwards because the first remainder you produce is the units bit, which belongs at the right-hand end.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Data Types and Number Representation, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.