levo

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.

Your recallNot started
Key term

Convert the denary number 156 to eight-bit binary using the place value method.

Key term

Why does hexadecimal need the letters A to F?

Key term

Convert the hexadecimal number 7A3 to binary.

Questions from this subtopic

Each one with the model answer underneath.

  1. 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. 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. 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. 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. 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. 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.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Processors: Structure, Performance and Types
Input, Output and Storage
Systems Software
Applications Generation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

A0 + 0 gives 0.
B0 + 1 gives 1.
C1 + 1 gives 0 carry 1.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

A global variable means a variable reachable from anywhere in the program.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

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.