0% found this document useful (0 votes)
8 views14 pages

AS Level Computer Science Data Representation

This document outlines the instructions and information for a Computer Science A-Level assignment for the session 2024-2025. It includes guidelines for submission, marking details, and specific questions related to data representation, including hexadecimal and binary conversions, ASCII code usage, and image compression techniques. Students are required to show their working and provide answers in designated spaces.

Uploaded by

maiersheikh4
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)
8 views14 pages

AS Level Computer Science Data Representation

This document outlines the instructions and information for a Computer Science A-Level assignment for the session 2024-2025. It includes guidelines for submission, marking details, and specific questions related to data representation, including hexadecimal and binary conversions, ASCII code usage, and image compression techniques. Students are required to show their working and provide answers in designated spaces.

Uploaded by

maiersheikh4
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 Alevel

Candidate
Name

Student ID

Computer Science 9618


Session 2024-2025
Chapter 1 (Data Representation)
AS Level

INSTRUCTIONS
● Scan the Assignment using Adobe Scan or Cam Scanner or attempt the assignment digitally using ipad
or similar equipment
● Document to be submitted via Student Portal
● Write your Name and Student ID in the boxes at the top of the page.
● Answer all questions.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your answer to each question in the space provided.
● You may use a calculator.
● You should show all your working and use appropriate units.

INFORMATION
● The total mark for this paper is 68.
● The number of marks for each question or part question is shown in brackets [ ].

[Turn over
1
2
3
4

(c) One of the colours used in the image has the hexadecimal colour code:

#FC238A

FC is the amount of red, 23 is the amount of green and 8A is the amount of blue in the colour.

(i) Convert the hexadecimal code FC into denary.

..................................................................................................................................... [1]

(ii) The amount of green in binary is 00100011. This has the denary number 15 added to it
to create a second colour.

Add the denary number 15 to the binary number 00100011 and give your answer in
binary.

Perform the addition in binary. Show your working.

Working .............................................................................................................................

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

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

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

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

Answer (in binary) ........................................


[3]

(iii) Hexadecimal 23 in two’s complement representation is 00100011. The denary number


10 needs to be subtracted from this value.

Subtract the denary number 10 from the two’s complement representation 00100011.

Give your answer in binary. Show your working.

Working .............................................................................................................................

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

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

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

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

Answer (in binary) ........................................


[3]
5
6

(ii) Wilbur wants to compress the scanned image before emailing it to his colleague.

Describe one lossy compression technique that Wilbur can use to compress this image.

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

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

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

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

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

..................................................................................................................................... [3]
7
8

(b) Character is another type of data.

The following tables show part of the ASCII code character set.

Character Denary value Character Denary value


A 65 a 97
B 66 b 98
C 67 c 99
D 68 d 100
E 69 e 101

(i) Describe how the computer uses ASCII codes to represent characters.

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

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

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

..................................................................................................................................... [2]

(ii) Convert the following string into ASCII codes.

Bed

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

..................................................................................................................................... [1]

(iii) Give the denary ASCII code for the following character.

..................................................................................................................................... [1]
9
10

(d) The hexadecimal colour value of the background of Xiaoming’s website is:

913C8E

Complete the following table by converting each hexadecimal value to denary value.

Red Green Blue

Hexadecimal value 91 3C 8E
Denary value
[2]
11
12

(ii) Complete the table by writing the ASCII denary value for the character ‘t’ and its
hexadecimal equivalent.

Character t

ASCII denary value

Hexadecimal value
[2]
13

Common questions

Powered by AI

ASCII (American Standard Code for Information Interchange) represents characters using a 7-bit binary number (0-127). Each character (e.g., A=65) is encoded with a unique binary value, allowing computers to interpret text. Limitations include a small character set, unsuitable for non-English alphabets; extensions like UTF-8 are used for broader compatibility.

The ASCII denary value for 't' is 116, determined from the ASCII table. Converting 116 to hexadecimal involves dividing by 16: - 116 / 16 = 7 remainder 4, giving the hexadecimal value 74.

For the hexadecimal colour 913C8E, convert each hex pair to denary: - Red (91): 9(9)*16^1 + 1*16^0 = 145 - Green (3C): 3(3)*16^1 + C(12)*16^0 = 60 - Blue (8E): 8(8)*16^1 + E(14)*16^0 = 142

Two's complement subtraction involves adding a negative value. First, convert the denary 10 to binary (00001010), find its two's complement by inverting and adding 1 (11110110), then add to 00100011: 00100011 + 11110110 = 00011001 (ignoring overflow), thus the result of subtraction is binary 00011001.

To convert the hexadecimal colour code #FC238A to its denary components, each two-character hexadecimal segment represents the intensity of a colour: red, green, and blue. Each segment is converted from hexadecimal to denary as follows: - Red (FC) is converted to denary by calculating F(15)*16^1 + C(12)*16^0 = 255. - Green (23) is converted to denary by calculating 2(2)*16^1 + 3*16^0 = 35. - Blue (8A) is converted to denary by calculating 8(8)*16^1 + A(10)*16^0 = 138.

To add a denary number to a binary number, first convert the denary number to binary, then perform binary addition. For adding 15 to 00100011, convert 15 to binary (1111). Align the binary numbers and perform addition, carrying over any excess as needed. 00100011 + 00001111 = 00110010, so the sum in binary is 00110010.

A common lossy compression technique for images is JPEG compression. It reduces file size by simplifying colour details, using transformations, quantization, and encoding. This technique can significantly reduce file size but degrades image quality, especially if over-compressed, causing artifacts like blockiness or blurring.

The ASCII codes for 'Bed' are derived by matching each character to its ASCII denary equivalent: - B = 66 - e = 101 - d = 100 This results in the sequence: 66, 101, 100.

You might also like