levo

Data Types and Number Representation

Binary, hexadecimal and denary conversion

  • 3 things to know
  • Component 01
Start revising · £5/month

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.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

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

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz consolidates the facts

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

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

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

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

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.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.