Bit Representation (College Board AP® Computer Science Principles): Revision Note

Robert Hampton

Written by: Robert Hampton

Reviewed by: James Woodhouse

Updated on

Binary representation & abstraction

What is binary?

  • All digital devices store and process data using binary, a number system that uses only two values: 0 and 1

  • A bit (binary digit) is the smallest unit of data in computing, representing a single 0 or 1

  • A byte is a group of 8 bits and is the fundamental building block of data storage

  • Digital devices use binary because electronic circuits have two states: on (1) and off (0)

  • Every piece of data on a device (text, images, sound, video) is stored as a representation made up of bit sequences

Abstraction and data types

  • Abstraction is the process of reducing complexity by hiding unnecessary detail and focusing on essential features

  • In computing, abstraction allows complex real-world data to be represented as bit sequences that a computer can process

  • A data type defines how a bit sequence should be interpreted; the same sequence of bits could represent a number, a character, or a color depending on the data type

  • Variables, lists, and constants are abstractions used in programs to store and organize data without the programmer needing to manage individual bits

  • Without abstraction, programmers would need to work directly with binary sequences; abstraction is what makes programming in human-readable languages possible

Analog vs digital data

What is the difference between analog and digital data?

  • Analog data is continuous, meaning it changes smoothly over time and can take any value within a range (for example, sound waves, temperature, or light intensity)

  • Digital data is discrete, meaning it is represented using a finite set of values (in computing, sequences of 0s and 1s)

  • Converting real-world analog data into digital form always involves some level of approximation, because continuous values must be rounded to the nearest available digital value

Feature

Analog data

Digital data

Nature

Continuous, smooth changes

Discrete, fixed values (0s and 1s)

Range of values

Infinite within a range

Finite, determined by the number of bits

Real-world examples

Sound waves, temperature readings

MP3 audio files, digital photographs

Precision

Exact at any point in time

An approximation of the original data

Digital sampling & conversion

How is analog data converted to digital?

  • Sampling is the process of measuring an analog signal at regular intervals and recording each measurement as a digital value

  • The more frequently the signal is sampled (higher sampling rate), the more accurately the digital version represents the original analog data

  • Each sample is stored as a sequence of bits, and the number of bits per sample determines the precision of each measurement

  • Conversion from analog to digital always involves some loss of information, because the continuous signal is only captured at specific points in time

A graph showing a continuous smooth wave representing analog data, overlaid with a stepped rectangular approximation representing the digital version. The steps align with regular sampling intervals on the horizontal axis, illustrating how digital sampling captures discrete values rather than the full continuous signal. The gap between the smooth curve and the stepped outline represents the information lost during analog to digital conversion.
A smooth analog wave overlaid with a stepped digital approximation, showing how sampling at regular intervals captures only specific points of the original signal

Examiner Tips and Tricks

  • The AP exam may ask why digital representations are approximations of analog data. The key reason is that analog data is continuous but digital data can only capture values at specific intervals. A higher sampling rate produces a closer approximation but never a perfect copy. When comparing analog and digital, focus on the trade-off between accuracy and storage size.

  • For the AP Create Performance Task, your program stores and processes data using variables and lists — on exam day you may be asked to explain how your program manages data, so be prepared to describe what data your program stores and why

Worked Example

A sound wave is sampled 1000 times per second. Each sample is stored using 8 bits. Which of the following best explains why the digital recording is an approximation of the original sound?

(A) The recording uses too many bits per sample

(B) The sound wave is only measured at specific intervals, so values between samples are not captured

(C) Digital devices cannot store sound data

(D) 8 bits is not enough to represent any sound

[1]

Answer:

(B) The sound wave is only measured at specific intervals, so values between samples are not captured [1 mark]

  • Analog sound is continuous but sampling only records values at fixed points in time — any changes between samples are lost, making the digital version an approximation of the original

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.