Floating Point & Character Representation (SQA National 5 Computing Science): Revision Note

Exam code: X816 75

Robert Hampton

Written by: Robert Hampton

Reviewed by: James Woodhouse

Updated on

Floating point

What is floating point?

  • Computers use floating point to store real numbers, numbers that have a fractional part

  • Floating point representation is similar to scientific notation, but it uses base 2 (binary) instead of base 10 (denary)

  • A floating point number is made up of two parts:

    • The mantissa

    • The exponent

Mantissa

  • The part of the number that holds the sequence of significant digits that make up the number

  • Controls the precision of the number

  • Does not change the scale of the number

Exponent

  • The part that shows how far the binary point moves

  • Controls the size or scale of the number

  • A larger exponent moves the point to the right (making a larger number)

  • A smaller exponent moves the point to the left (making a smaller number)

Example

  • In scientific notation

    • 0.8916 × 10³

  • Mantissa = 8916

  • Exponent = 3

  • The same idea applies in binary, but it uses powers of 2 instead of powers of 10

Examiner Tips and Tricks

  • Floating point representation allows fractions to be stored in binary form

  • You do not need to calculate binary floating point values in the National 5 exam

Worked Example

A weather station recorded the maximum wind speed as 47.3 meters per second. This value would be stored in a computer system using floating-point representation as shown below:

  • 0.473×102

Identify the mantissa and the exponent in the above floating-point representation.

Component

Value

Mantissa

Exponent

[2]

Answer

Component

Value

Mantissa

473 [1 mark]

Exponent

2 [1 mark]

Extended ASCII

What is extended ASCII?

  • Extended ASCII is a character set used to represent text on a computer system

  • It uses 8 bits for each character, giving 256 unique codes (2⁸ = 256)

  • Each character, letters, numbers or symbols, is given a unique binary code

  • This means that text can be stored and processed consistently on different computer systems

How extended ASCII is used

  • Extended ASCII is used to represent:

    • Upper and lower case letters

    • Numbers 0–9

    • Punctuation marks and special characters (for example !, @, #, £)

    • Additional symbols such as mathematical signs or accented letters

Calculating storage using extended ASCII

  • Each character requires 8 bits (1 byte) of storage

  • Formula:

    • Bits required = number of characters × 8

  • Examples:

    • “SERVER” has 6 characters → 6 × 8 = 48 bits

    • “GRK_0183_J” has 10 characters → 10 × 8 = 80 bits

    • “Par Tee” has 7 characters (including the space) → 7 × 8 = 56 bits

  • Sometimes you may be asked the reverse calculation:

  • Formula:

    • Characters stored = total bits ÷ 8

  • For example, 80 bits ÷ 8 = 10 characters

Worked Example

A small online book retailer uses extended ASCII code to store information.

The retailer wants to send a promotional code via email. This code, including all letters and the mandatory dash symbol, uses a total of 96 bits of storage.

Calculate the maximum number of characters that the promotional code can contain.

[1]

Answer

  • 96 bits÷8 bits per character = 12 characters [1 mark]

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Robert Hampton

Author: Robert Hampton

Expertise: Computer Science Content Creator

Rob has over 16 years' experience teaching Computer Science and ICT at KS3 & GCSE levels. Rob has demonstrated strong leadership as Head of Department since 2012 and previously supported teacher development as a Specialist Leader of Education, empowering departments to excel in Computer Science. Beyond his tech expertise, Robert embraces the virtual world as an avid gamer, conquering digital battlefields when he's not coding.

James Woodhouse

Reviewer: James Woodhouse

Expertise: Computer Science & English Subject Lead

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.