0% found this document useful (0 votes)
6 views9 pages

OLevel 2210ExamStyleQuestionWithAnswers

The document contains exam-style questions and answers related to data representation in computer science, focusing on topics like sampling resolution, image resolution, compression techniques, and binary arithmetic. It explains concepts such as the impact of sampling resolution on accuracy, the differences between lossy and lossless compression, and how images are converted to digital files. Additionally, it discusses pixel representation, colour depth, and the number of images that can be stored on a memory device.

Uploaded by

1181738
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views9 pages

OLevel 2210ExamStyleQuestionWithAnswers

The document contains exam-style questions and answers related to data representation in computer science, focusing on topics like sampling resolution, image resolution, compression techniques, and binary arithmetic. It explains concepts such as the impact of sampling resolution on accuracy, the differences between lossy and lossless compression, and how images are converted to digital files. Additionally, it discusses pixel representation, colour depth, and the number of images that can be stored on a memory device.

Uploaded by

1181738
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Cambridge O Level Computer Science (2210)

Data Representation – Exam Style Paper with Answers (page # 41)

Question 1
(a)(i) Sampling resolution [1]

Number of bits used to represent each sample.

(a)(ii) Effect on accuracy [3]

• Higher sampling resolution uses more bits per sample. (1)


• This allows a greater number of possible amplitude values. (1)
• Therefore the digitised sound is a more accurate/realistic representation of the original
sound wave. (1)

Keyword to note: More bits per sample → more possible amplitude values → more
accurate representation of sound.

(b)(i) Image resolution [1]

Total number of pixels (width × height).

(b)(ii) Bits per pixel [1]

2^n = 16 → n = 4 bits.

(b)(iii) File size [3]

Pixels = 16384 × 512 = 8,388,608


Bits = ×8 = 67,108,864 bits
Bytes = ÷8 = 8,388,608
≈ 0.0078 GiB

(b)(iv) Compression [3]

Lossy removes data to reduce size. Lossless keeps all data. Example: RLE/JPEG.
Question 2
(a) Sampling [3]

• The sound wave is measured at regular time intervals (sampling). (1)


• Each sample’s amplitude is recorded and converted into a binary value. (1)
• The binary values are stored to form the digital sound file. (1)

Keywords to remember: Sound measured at regular intervals, converted to binary and


stored.

(b) Compression [3]

• Lossy compression should be used. (1)


• It removes some unnecessary data from the sound file. (1)
• This significantly reduces the file size, making it quicker and easier to send via email.
(1)

(c)(i) RLE [3]

• Run Length Encoding (RLE) is a lossless compression technique. (1)


• It stores data by recording a value and the number of times it repeats. (1)
• This reduces file size when there are many repeated values. (1)

(c)(ii) Example [4]

Pattern in an image: 3G2W4G9W4G2W1G2W2G2W1G

Gray square =0 and white square=1

Substituting values in an identified pattern: 3021409140211021202110


Question 3
a) 00110110 = 54
b)

i) 1 Right shift → 00011011

ii) 1 Right shift → 00011011 = 27


c)

i) 2 Left shift of the original value→ 11011000


ii) Effect: value increases ×4, overflow possible.

Question 4
a)

i) 123 → 01111011
ii) 55 → 00110111
iii) 180 → 10110100

b)

i) 123 + 55 = 178 → 10110010


ii) 123 + 180 → overflow

c) Two’s complement:

i)

Key to remember: In two’s complement: If MSB (first bit) is 0, the number is


positive.

-128 64 32 16 8 4 2 1
0 1 1 1 0 1 0 0
add all the 1 values to find out the given value of 2’s complement: 64+32+16+4=116

ii)

Step 1: Write +112 in binary

112 = 64 + 32 + 16
So:

112 = 01110000
Step 2: Take two’s complement

1. Invert bits:

01110000 → 10001111

2. Add 1:

10001111
+ 1
---------
10010000

-128 64 32 16 8 4 2 1
1 0 0 1 0 0 0 0

iii)

-128 64 32 16 8 4 2 1
1 0 1 1 1 0 0 1

-128+32+16+8+1=-71

d) i) 104

-128 64 32 16 8 4 2 1
0 1 1 0 1 0 0 0

Ii) -104

Step 1: Convert +104 to binary

104 = 64 + 32 + 8

So:
104 = 01101000

Step 2: Take two’s complement

Invert bits:

01101000 → 10010111

Add 1:
10010111
+ 1
---------
10011000

−104 = 10011000 (in 8-bit two’s complement)

-128 64 32 16 8 4 2 1
1 0 0 1 1 0 0 0

Question 5
Pixel:

• A pixel (picture element) is the smallest individual dot of a digital image.


• Each pixel stores a single colour value.
• when many pixels are combined, they form the complete image.
Colour depth: bits per pixel

Colour depth

• Color Depth is the number of bits used to represent the colour of each pixel.
• It determines how many different colours an image can display.
• For example, 24-bit colour depth allows 2^24 different colours.

c) Number of images on a 32 GiB memory stick

Step 1: Total pixels in one image


1140×1080=1,231,200 pixels

Step 2: Bits per image


Colour depth = 24 bits per pixel

So: 1,231,200×24=29,548,800 bits per image

Step 3: Convert to bytes


29,548,800÷8=3,693,600 bytes per image

Step 4: Convert memory stick size to bytes


1 GiB = 1024^3=1,073,741,824 bytes

32 GiB = 32×1,073,741,824=34,359,738,368 bytes

Step 5: Number of images


34,359,738,368÷3,693,600≈9304
✅ Final Answer:

Approximately 9,304 images

d) How to increase number of images stored

You can store more images by:

• Reducing resolution (fewer pixels per image → smaller file size)


• Reducing colour depth (fewer bits per pixel → less data per image)
• Using image compression (especially lossy compression like JPEG to reduce file
size significantly)

Question 6
a) How captured images are converted to digital photo files

When Nancy takes a photo using a digital camera:

1. Light enters the camera lens and falls on a light-sensitive sensor (CCD or CMOS).
2. The sensor is divided into millions of tiny cells called pixels.
3. Each pixel measures the intensity and colour of light it receives.
4. These values are converted into binary data (0s and 1s) by an analogue-to-digital
converter (ADC).
5. The binary data is then processed and stored as a digital image file (such as JPEG
or PNG) on the camera’s memory card.

b) Best type of file compression

Answer: Lossy compression

Explanation:

• Lossy compression reduces file size by removing some image data permanently.
• It is ideal for photos because the removed data is usually not noticeable to the
human eye.
• It produces much smaller file sizes, making it easier to email or share many
images.
• Common format: JPEG.
Question 7
a)

02 → 00000010
31 → 00011111
58 → 00111010
b) Result: 05:26:55

Question 8
a) Number of photographs (10 KiB each) in 64 GiB

Step 1: Convert 64 GiB to KiB

1 GiB = 1024 MiB


1 MiB = 1024 KiB

So:

64×1024×1024=67,108,864 KiB

Step 2: Divide by photo size

Each photo = 10 KiB

6,710,8864÷10=6,710,886.4

Answer:

6,710,886 photographs (approx.)

b) Photographs on SSD

i) One way of reducing file size

Use file compression (lossy compression such as JPEG)

ii) Two advantages of reducing file size

• Uses less storage space on the SSD


• Faster transfer/uploading of files (e.g. sharing or backup)

iii) One disadvantage of reducing file size

• Loss of image quality / detail (especially with lossy compression)

c) Bitmap images

i) Why 3 bytes are needed per pixel

• Each pixel uses 24 bits (colour depth)


• 24 bits = 8 bits × 3 = 3 bytes
• Each byte stores one primary colour channel:
o Red
o Green
o Blue

So each pixel needs 3 bytes to represent its colour combination.

ii) Number of possible colours

Each byte has 256 possible values (0–255).

So:

• Red = 256 values


• Green = 256 values
• Blue = 256 values

Total colours:

256×256×256=16,777,216

Answer:

16,777,216 possible colours

You might also like