9618/13

Computer Science 9618/13May/June 2022

Cambridge AS Level · Theory Fundamentals · worked solutions for every part, with the mark scheme

8
questions
75
marks
90
minutes

Topics Processor Fundamentals · Information Representation · System Software · Security, Privacy and Data Integrity · Databases · Hardware · +1 more

Q1Information RepresentationFree sample

Text and numbers are examples of data stored in a computer.

(a)

A character set is used to represent characters in a computer.

(i)

Describe what is meant by a character set.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.....................................................................................................................................

2M
DifficultyEasy
Worked solution

Answer

  • A character set is a defined collection of characters that a computer can represent.
  • Each character is assigned a unique binary code/value.
Final answer

A defined set of characters where each character has a unique binary code.

Detailed explanation

Background Concept

Computers do not store letters, digits and symbols as visible characters. They store bit patterns. A character set is the standard that links each character to a numeric code, which is then stored in binary.

For example, a character such as A, a digit such as 7, or a symbol such as ? must each have their own code. The important idea is that the mapping is defined in advance and is unique, so whenever the computer sees a particular code it knows exactly which character it represents.

Common character sets include ASCII, extended ASCII and Unicode.

Understanding the Question

This question asks for the meaning of the term character set. It is not asking for examples only, and it is not asking for details of one specific set such as ASCII. To gain the marks, you need to describe the general idea:

  • it is a list or collection of characters
  • each character is given its own code

Approach

A good exam definition here has two parts:

  1. say that it is a defined set of characters that can be represented
  2. say that every character has a unique code, usually stored in binary

That covers both what the set contains and how the computer uses it.

Step-by-Step Reasoning

Start with the word character. In this topic, a character means one symbol such as a letter, number, punctuation mark or control code.

Then explain what a set means in this context: a recognised collection of those characters.

Finally explain representation: the computer must store each one as a code. Because computers store binary, that code is represented as bits.

So the full idea is that a character set is a standard mapping between characters and binary codes. The uniqueness matters because if two characters shared the same code, the computer would not know which one to display.

Key Takeaways

  • A character set is a standard list of representable characters.
  • Each character has its own unique code.
  • The code is what the computer actually stores.

Common Mistakes

  • Saying only a set of letters. A character set includes more than letters, such as digits and symbols.
  • Saying characters are stored directly. Computers store codes, not the visual characters themselves.
  • Giving only an example such as ASCII without explaining what a character set is.

Things to Be Careful About

Be precise with the word unique. The key exam point is that each character has its own code. Also avoid describing a font or keyboard layout, because those are different ideas from a character set.

Techniques used
define a standard mapping between characters and codesstate that each character has a unique binary representation
(ii)

Identify two character sets and state one difference between them.

Character set 1 ..................................................................................................................

Character set 2 ..................................................................................................................

Difference ..........................................................................................................................

...........................................................................................................................................

3M
DifficultyMedium-Easy
Worked solution

Answer

  • Character set 1: ASCII
  • Character set 2: Unicode
  • Difference: ASCII uses 7 bits and represents 128 characters, whereas Unicode can represent many more characters from many languages.
Final answer

ASCII; Unicode; ASCII uses 7 bits for 128 characters, while Unicode represents many more characters.

Detailed explanation

Background Concept

Different character sets were created because computers need agreed standards for storing text. Early systems used small character sets because memory was limited. Modern systems need to represent many languages and symbols, so larger standards were developed.

ASCII is a common early character set. Standard ASCII uses 7 bits, so it can represent 128 different codes. Unicode is a much larger standard designed to represent characters from many languages, as well as symbols and emoji.

Extended ASCII is another example. It usually uses 8 bits, giving 256 possible codes, but it is still much smaller and less universal than Unicode.

Understanding the Question

This question has three tasks:

  • name one character set
  • name a second character set
  • give one difference between them

A safe choice is ASCII and Unicode, because their difference is clear and widely accepted.

Approach

Choose two well-known valid examples from the syllabus. Then state one straightforward difference, such as:

  • number of bits used
  • number of characters possible
  • range of languages/symbols supported

The difference must be specific, not vague.

Step-by-Step Reasoning

First, select two valid character sets. From the syllabus, good choices are ASCII, extended ASCII and Unicode.

Next, compare them. If you choose ASCII and Unicode:

  • ASCII is a smaller, older standard.
  • Standard ASCII uses 7 bits, so it has 128 codes.
  • Unicode is designed to cover many more characters from many writing systems.

That gives a clear technical difference. You could also compare ASCII with extended ASCII by saying extended ASCII uses 8 bits and can represent 256 characters, while ASCII uses 7 bits and represents 128 characters.

Key Takeaways

  • Valid examples include ASCII, extended ASCII and Unicode.
  • Differences can be based on bit size, number of characters or language support.
  • Unicode is used because modern computing needs far more characters than ASCII provides.

Common Mistakes

  • Naming something that is not a character set, such as UTF alone without understanding the context.
  • Saying one is better than the other without giving a technical difference.
  • Giving two examples but no comparison point.

Things to Be Careful About

Make sure the difference is accurate. Standard ASCII is 7-bit, not 8-bit. If you mention extended ASCII, that is the 8-bit version. Also, do not say Unicode is simply 16-bit in all cases, because Unicode can be implemented in different encoding forms.

Techniques used
identify valid examples of character setscompare character capacity between standardsstate a clear technical difference
(iii)

Describe how lossless compression can be used to reduce the file size of a text file.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.....................................................................................................................................

2M
DifficultyMedium-Easy
Worked solution

Answer

  • Lossless compression reduces the file size by replacing repeated characters, words or patterns with shorter codes.
  • When the file is decompressed, the exact original text is restored with no data lost.
Final answer

Use lossless compression to replace repeated patterns with shorter codes so the exact original text can be restored.

Detailed explanation

Background Concept

Compression reduces the amount of storage needed for data. There are two main categories:

  • lossless compression: no data is permanently removed, so the original file can be rebuilt exactly
  • lossy compression: some data is discarded to make the file smaller

Text files normally need lossless compression because every character matters. A lossless method looks for repetition or patterns and stores them more efficiently. For example, repeated symbols or common sequences may be replaced by shorter codes.

Understanding the Question

The question asks how lossless compression can reduce the size of a text file. So you need to explain both:

  • what the compression does to make the file smaller
  • why it is suitable for text

The key idea is exact recovery of the original text.

Approach

A complete answer should mention:

  1. repeated data or common patterns are encoded more efficiently
  2. no information is lost
  3. decompression recreates the original text exactly

That is enough for full credit in a short theory question.

Step-by-Step Reasoning

A text file contains characters, and many files contain repetition. This repetition may be repeated letters, spaces, words or other patterns.

A lossless compression algorithm analyses the file and replaces some of that repeated information with a shorter form. For example, instead of storing the same pattern many times, it can store a code that stands for that pattern.

Because the method is lossless, the coding system keeps enough information to reverse the process exactly. When decompressed, the text file returns to precisely the same sequence of characters as before.

That exact restoration is the reason lossless compression is appropriate for text.

Key Takeaways

  • Lossless compression reduces storage without changing the original data.
  • It works by storing repeated or predictable data more efficiently.
  • Text files must usually be restored exactly, character for character.

Common Mistakes

  • Saying compression just removes spaces or deletes characters. That would not be lossless.
  • Mentioning only that the file gets smaller, without explaining how.
  • Confusing lossless with lossy.

Things to Be Careful About

The phrase exact original text is important. For text files, even one changed character can alter meaning, spelling, numbers or program code. So always link lossless compression with exact reconstruction.

Techniques used
describe replacement of repeated patterns with shorter codesstate that the original data can be reconstructed exactly
(iv)

Explain why lossy compression should not be used on a text file.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.....................................................................................................................................

2M
DifficultyMedium-Easy
Worked solution

Answer

  • Lossy compression permanently removes some data, so the original text cannot be recovered exactly.
  • If characters are changed or lost, the text may become incorrect or its meaning may change.
Final answer

Lossy compression removes data permanently, so the exact original text cannot be recovered and the text may be changed.

Detailed explanation

Background Concept

Lossy compression achieves smaller file sizes by discarding some information. This is acceptable for data such as images, audio or video where a small change may not be noticed easily by a human user.

Text is different. In a text file, every character is significant. Changing one letter can change a word, one digit can change a number, and one missing symbol can break program code or data.

Understanding the Question

The question asks why lossy compression should not be used for a text file. The clue is the word not. You are expected to explain the problem with lossy methods in this particular context.

So the answer must connect:

  • lossy compression removes data permanently
  • text files need exact accuracy

Approach

The best approach is to make the contrast very direct:

  1. describe what lossy compression does
  2. state that the original cannot be reconstructed exactly
  3. explain why that is unacceptable for text

Step-by-Step Reasoning

When a file is compressed using a lossy method, some of the original information is thrown away. That is what makes the file smaller.

If this happens to a text file, the lost information could mean a changed character, a missing symbol or an altered word. Unlike an image, where a tiny colour change may be unnoticed, a tiny change in text can have a large effect.

Examples:

  • not becoming now changes the meaning
  • 100 becoming 10 changes the value
  • a missing bracket in program code can cause an error

So the reason lossy compression should not be used is that the exact original text may no longer exist after decompression.

Key Takeaways

  • Lossy compression discards data permanently.
  • Text needs exact preservation.
  • Even a very small change in text can have major consequences.

Common Mistakes

  • Saying only that lossy compression gives poor quality. Quality is more relevant to sound and images than text.
  • Saying lossy compression cannot be decompressed at all. It can be decompressed, but not back to the exact original.
  • Forgetting to link the answer specifically to text files.

Things to Be Careful About

Use the word exact or equivalent wording such as unchanged original. That is the core point. Also avoid suggesting that lossy compression is always bad; it is unsuitable here because text data must be precise.

Techniques used
explain permanent data loss in lossy compressionrelate altered data to the need for exact text recovery
(b)

A computer can represent numerical data in different forms.

Complete the table by writing the answer to each statement.

StatementAnswer
The hexadecimal value 11 represented in denary
The smallest denary number that can be represented by an unsigned 8-bit binary integer
The denary number 87 represented in Binary Coded Decimal (BCD)
The denary number 240 represented in hexadecimal
The denary number –20 represented in 8-bit two’s complement binary

Working space

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

5M
DifficultyMedium
Worked solution

Working

  • Hexadecimal 11 in denary = 1 × 16 + 1 = 17
  • Smallest unsigned 8-bit value = 0000 0000 = 0
  • BCD for 87 = 81000, 70111, so 1000 0111
  • Denary 240 in hexadecimal = 15 remainder 0 in base 16 = F0
  • 20 in 8-bit binary = 0001 0100
  • Invert bits = 1110 1011
  • Add 1 = 1110 1100

Answer

StatementAnswer
The hexadecimal value 11 represented in denary17
The smallest denary number that can be represented by an unsigned 8-bit binary integer0
The denary number 87 represented in Binary Coded Decimal (BCD)1000 0111
The denary number 240 represented in hexadecimalF0
The denary number –20 represented in 8-bit two’s complement binary1110 1100
Final answer

17; 0; 1000 0111; F0; 1110 1100

Detailed explanation

Background Concept

Computers can store numbers in several different forms depending on the purpose.

  • Denary is base 10, the normal human number system.
  • Binary is base 2, using only 0 and 1.
  • Hexadecimal is base 16, using 0–9 and A–F.
  • BCD stores each denary digit separately as a 4-bit binary value.
  • Two's complement is the standard way to represent negative integers in binary.

Unsigned binary means all bits are used for the magnitude, so there are no negative values. In 8 bits, the range is 0 to 255.

For 8-bit two's complement, positive values look like normal binary when the first bit is 0. Negative values are found by taking the positive binary value, inverting the bits, and adding 1.

Understanding the Question

This question gives five separate number-representation statements and asks you to complete each one. That means you must recognise which representation each row is using and apply the correct conversion method.

The rows cover:

  • hexadecimal to denary
  • range of unsigned 8-bit binary
  • denary to BCD
  • denary to hexadecimal
  • negative denary to 8-bit two's complement

Because the methods differ from row to row, careful reading is important.

Approach

Treat each row independently.

  1. For hexadecimal to denary, use place value in base 16.
  2. For the unsigned 8-bit minimum, recall the range directly.
  3. For BCD, convert each denary digit separately into 4 bits.
  4. For denary to hexadecimal, divide by 16 or use base-16 place value.
  5. For negative two's complement, write the positive value in 8 bits, invert, then add 1.

This avoids mixing up the rules for different representations.

Step-by-Step Reasoning

First row: hexadecimal 11 to denary.

In hexadecimal, the places are powers of 16. So:

  • left digit 1 means 1 × 16
  • right digit 1 means 1 × 1

Add them:

16 + 1 = 17

So the denary value is 17.

Second row: smallest denary number in unsigned 8-bit binary.

Unsigned means no sign bit. The smallest possible bit pattern is all zeros:

0000 0000

That equals 0 in denary.

Third row: denary 87 in BCD.

BCD does not convert the whole number to binary at once. Instead, convert each denary digit separately:

  • 8 becomes 1000
  • 7 becomes 0111

Put them together:

1000 0111

A common mistake would be converting 87 to ordinary binary, which would give a different answer.

Fourth row: denary 240 in hexadecimal.

Divide by 16:

  • 240 ÷ 16 = 15 remainder 0

In hexadecimal, 15 is F, so the number is F0.

You can also see it as:

  • F × 16 + 0 = 15 × 16 = 240

Fifth row: denary -20 in 8-bit two's complement.

Start with positive 20 in 8 bits:

0001 0100

Invert every bit:

1110 1011

Add 1:

1110 1100

So -20 is 1110 1100 in 8-bit two's complement.

Key Takeaways

  • Hexadecimal conversions use powers of 16.
  • Unsigned 8-bit integers start at 0.
  • BCD converts each denary digit separately, not the whole number.
  • Two's complement for a negative number is invert the positive value and add 1.
  • Always pay attention to the requested representation.

Common Mistakes

  • Writing 11 for hexadecimal 11 in denary. Hexadecimal 11 is not denary eleven; it is seventeen.
  • Giving normal binary for 87 instead of BCD.
  • Forgetting that unsigned numbers cannot be negative.
  • Converting -20 by just putting a minus sign in front of binary. Negative binary integers in this syllabus use two's complement.
  • Forgetting to use 8 bits throughout the two's complement conversion.

Things to Be Careful About

Bit length matters. For two's complement, the answer must be exactly 8 bits. In BCD, each denary digit must use exactly 4 bits. Also be careful not to confuse hexadecimal letters: A=10, B=11, C=12, D=13, E=14, F=15.

Techniques used
convert hexadecimal to denaryidentify the minimum value of an unsigned binary integerencode denary digits in Binary Coded Decimalconvert denary to hexadecimalform an 8-bit two's complement value

The rest of this paper

7 more questions
  • Q2Processor Fundamentals8M
  • Q3Processor Fundamentals10M
  • Q4System Software9M
  • Q5Security, Privacy and Data Integrity10M
  • Q6Databases13M
  • Q7Hardware5M
  • Q8Communication6M
Loading the full paper…