Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

THE GPA GYM EDUCATION FOR ALL.

COMPUTER SCIENCE 9618


AS LEVEL COMPILED
NOTES

Founded four years ago under a different name, The Gpa Gym initially aimed to
assist peers and students. It has since grown into an educational platform, helping
underprivileged students like those in reputable schools.

We're thrilled to support your journey to success and have uploaded all Computer
Science 9618 notes and resources. We're working on a website and app to further
aid your academic journey, but it'll take time to develop.

Your feedback is valuable as we continuously improve our services. Join our team
by sharing helpful resources for Computer Science 9618 via email at
gymandgpa@gmail.com. Your contributions will support students who can't afford
expensive tuition. Describe the shared resources' usefulness when you’re providing
us with the resources.

Thank you for being part of our mission to make education accessible to all.

Mail:
gymandgpa@gmail.com
Website:
www.thegpagym.com

THE GPA GYM


THE GPA GYM EDUCATION FOR ALL.

Instagram:
@thegpagym

Content overview
AS Level Content
1 Information representation
1.1 Data Representation 1.2 Multimedia – Graphics, Sound 1.3 Compression

2 Communication
2.1 Networks including the internet

3 Hardware
3.1 Computers and their components 3.2 Logic Gates and Logic Circuits

4 Processor Fundamentals
4.1 Central Processing Unit (CPU) Architecture 4.2 Assembly Language 4.3 Bit manipulation

5 System Software
5.1 Operating System 5.2 Language Translators

6 Security, privacy and data integrity


6.1 Data Security 6.2 Data Integrity

7 Ethics and Ownership


7.1 Ethics and Ownership

8 Databases
8.1 Database Concepts 8.2 Database Management System (DBMS) 8.3 Data Definition Language
(DDL) and Data Manipulation Language (DML)

9 Algorithm Design and Problem-Solving


9.1 Computational Thinking Skills 9.2 Algorithms

10 Data Types and structures


10.1 Data Types and Records 10.2 Arrays 10.3 Files 10.4 Introduction to Abstract Data Types (ADT)

11 Programming
11.1 Programming Basics 11.2 Constructs 11.3 Structured Programming

12 Software Development
12.1 Program Development Lifecycle 12.2 Program Design 12.3 Program Testing and maintenance

THE GPA GYM


THE GPA GYM EDUCATION FOR ALL.

Assessment
If you are following the AS Level course, you will take two examination papers:
» Paper 1 Theory Fundamentals (1 hour 30 minutes)
» Paper 2 Fundamental Problem-solving and Programming Skills (2 hours)
If you are studying the A Level course, you will take four examination papers, Papers 1 and 2 and
also:
» Paper 3 Advanced Theory (1 hour 30 minutes)
» Paper 4 Practical (2 hours 30 minutes)
Note that calculators must not be used in any paper.

THE GPA GYM


THE GPA GYM EDUCATION FOR ALL.

DATA REPRESENTATION
What you should know:
Binary – base two number system based on the values
0 and 1 only.
Bit – abbreviation for binary digit.
One’s complement – each binary digit in a number is
reversed to allow both negative and positive numbers to
be represented.
Two’s complement – each binary digit is reversed and
1 is added in right-most position to produce another
method of representing positive and negative numbers.
Sign and magnitude – binary number system where
left-most bit is used to represent the sign (0 = + and 1 =
–); the remaining bits represent the binary value.
Hexadecimal – a number system based on the value 16
(uses the denary digits 0 to 9 and the letters A to F).
Memory dump – contents of a computer memory
output to screen or printer.
Binary-coded decimal (BCD) – number system that
uses 4bits to represent each denary digit.
ASCII code – coding system for all the characters on a
keyboard and control codes.
Character set – a list of characters that have been
defined by computer hardware and software. It is
THE GPA GYM
THE GPA GYM EDUCATION FOR ALL.

necessary to have a method of coding, so that the


computer can understand human characters.
Unicode – coding system which represents all the
languages of the world (first 128 characters are the
same as ASCII code).

NUMBER SYSTEMS
No matter how complex the system, the basic building block in all
computers is the binary number system. Since computers contain
millions and millions of tiny ‘switches’, which must be in the ON or
OFF position, this lends itself logically to the binary system. A switch
in the ON position can be represented by 1; a switch in the OFF

THE GPA GYM


THE GPA GYM EDUCATION FOR ALL.

position can be represented by 0. Each of the binary digits are known


as bits.
The binary system uses 1s and 0s only.

See the column weighting below:


128 64 32 16 8 4 2 1
27 26 25 24 23 22 21 20

Converting from binary to denary and from denary to binary


It is straightforward to change a binary number into a denary number.
Each time a 1 appears in a column, the column value is added to the
total. For example, the binary number above is:
128 + 64 + 32 + 8 + 4 + 2 = 238 (denary)

The 0 values are simply ignored when calculating the total. The
reverse operation – converting from denary to binary – is slightly
more complex. There are two basic ways of doing this. Consider the
conversion of the denary number, 107, into binary.....
Method 1
This method involves placing 1s in the appropriate position so that the
total equates to 107.
128 64 32 16 8 4 2 1
0 1 1 0 1 0 1 1

Method 2
This method involves successive division by 2; the remainders are
then written from bottom to top to give the binary value.

THE GPA GYM


THE GPA GYM EDUCATION FOR ALL.

Binary addition and subtraction


Computers have to store integer values for a number of purposes.
Sometimes the requirement is only for an unsigned integer to be
stored . However, in many cases a signed integer is needed where the
coding has to identify whether the number is positive or negative. An
unsigned integer can be stored simply as a binary number. The only
decision to be made is how many bytes should be used. If the choice
is to use two bytes (16 bits) then the range of values that can be
represented is 0 to 2^16 - 1 which is 0 to 65535.
If a signed integer is to be represented, the obvious choice is to use
one bit to represent the + or - sign. The remaining bits then represent
the value.
This is referred to as 'sign and magnitude representation'. However,
there are several disadvantages in using this format.
The approach generally used is to store signed integers in two's
complement form. Here we need two definitions. The one's
complement of a binary number is defined as the binary number
obtained if each binary digit is individually subtracted from 1 which,
in practice, means that each 0 is switched to 1 and each 1 switched to
0.

THE GPA GYM


THE GPA GYM EDUCATION FOR ALL.

In one’s complement, each digit in the binary number is inverted (in


other words, 0 becomes 1 and 1 becomes 0). For example, 0 1 0 1 1 0
1 0 (denary value 90) becomes 1 0 1 0 0 1 0 1 (denary value −90).
The two's complement is defined as the binary number obtained if 1
is added to the one's complement number.
To convert a binary number to its two's complement form quickly,
follow these steps:

1. Start from the least significant bit and move left, ignoring leading
zeros until the first 1 is encountered.

2. Ignore the first 1 and flip all the remaining bits from that point.
Change 0s to 1s and 1s to 0s.

For example, converting the binary number 10100100 to two's


complement form, the rightmost 100 remains unchanged, and the
remaining 10100 changes to 01011. Thus, the result is 01011100.
Two’s complement makes binary addition and subtraction more
straightforward. The reader is left to investigate one’s complement
and the sign and magnitude method in binary arithmetic.
Now that we are introducing negative numbers, we need a way to
represent these in binary. The two’s complement uses these
weightings for an 8-bit number representation:
−128 64 32 16 8 4 2 1
This means:
-128 64 32 16 8 4 2 1
1 1 0 1 1 0 1 0
0 0 1 0 0 1 1 0

THE GPA GYM


THE GPA GYM EDUCATION FOR ALL.

The first example is: −128 + 64 + 16 + 8 + 2 = −38 The second


example is: 32 + 4 + 2 = 38 The easiest way to convert a number into
its negative equivalent is to use two’s complement.

(Memory sizes and denary values.)


This only refers to some storage devices. IEC memory size system is
more accurate:

Binary coded decimal (BCD)


One exception to grouping bits in bytes to represent integers is the
binary coded decimal (BCD) scheme.
If there is an application where single denary digits are required to be
stored or transmitted, BCD offers an efficient solution.
The BCD code uses four bits (a nibble) to represent a denary digit. A
four-bit code can represent 16 different values so there is scope for a
variety of schemes.
This discussion only considers the simplest BCD coding which
expresses the value directly as a binary number. If a denary number
with more than one digit is to be converted to BCD there must be a
group of four bits for each denary digit.

THE GPA GYM


THE GPA GYM EDUCATION FOR ALL.

There are, however, two options for BCD; the first is to store one
BCD code in one byte leaving four bits unused. The other option is
packed BCD where two 4-bit codes are stored in one byte.
There are several applications where BCD can be used.
The obvious type of application is where denary digits are to be
displayed, for instance on the screen of a calculator or in a digital time
display.
A somewhat unexpected application is for the representation of
currency values. When a currency value is written in a format such as
$300.25 it is as a fixed-point decimal number (ignoring the dollar
sign).

ASCII CODES AND UNICODES


The ASCII code system stands for American Standard Code for
Information Interchange.
The standard ASCII code character set consists of 7-bit codes (0 to
127 denary or 0 to 7F in hexadecimal); this represents the letters,
numbers and characters found on a standard keyboard together with
32 control codes (which use up codes 0 to 31 (denary) or 0 to 19
(hexadecimal)).
One coding system is called Unicode. Unicode allows characters in a
code form to represent all languages of the world, thus supporting

THE GPA GYM


THE GPA GYM EDUCATION FOR ALL.

many operating systems, search engines and internet browsers used


globally.
There is overlap with standard ASCII code, since the first 128
(English) characters are the same, but Unicode can support several
thousand different characters in total.

Multimedia
What you should know:
 Bit-map image – system that uses pixels to
make up an image.
 Pixel – smallest picture element that
makes up an image.
 Colour depth – number of bits used to
represent the colours in a pixel, e.g. 8 bit
colour depth can represent 28 = 256
colours.
 Bit depth – number of bits used to
represent the smallest unit in, for example,
a sound or image file – the larger the bit
depth, the better the quality of the sound or
colour image.

THE GPA GYM


THE GPA GYM EDUCATION FOR ALL.

 Image resolution – number of pixels that


make up an image, for example, an image
could contain 4096 × 3192 pixels
(12738656 pixels in total).
 Screen resolution – number of horizontal
and vertical pixels that make up a screen
display. If the screen resolution is smaller
than the image resolution, the whole image
cannot be shown on the screen, or the
original image will become lower quality.
 Resolution – number of pixels per column
and per row on a monitor or television
screen.
 Pixel density – number of pixels per
square centimetre.
 Vector graphics – images that use 2D
points to describe lines and curves and
their properties that are grouped to form
geometric shapes.
 Sampling resolution – number of bits used
to represent sound amplitude (also known
as bit depth). Sampling rate – number of
sound samples taken per second.
THE GPA GYM
THE GPA GYM EDUCATION FOR ALL.

 Frame rate – number of video frames that


make up a video per second.
Bit-map images
They are made up of pixels (picture elements);
the image is stored in a two-dimensional
matrix of pixels. Pixels can take different
shapes.
When storing images as pixels, we have to
consider
» at least 8bits (1 byte) per pixel are needed to
code a coloured image (this gives 256 possible
colours by varying the intensity of the blue,
green and red elements)
» true colour requires 3bytes per pixel
(24bits), which gives more than one million
colours
» the number of bits used to represent a pixel
is called the colour depth.
In terms of images, we need to distinguish
between bit depth and colour depth; for
example, the number of bits that are used to
THE GPA GYM
THE GPA GYM EDUCATION FOR ALL.

represent a single pixel (bit depth) will


determine the colour depth of that pixel. As
the bit depth increases, the number of possible
colours which can be represented also
increases.
We will now consider the actual image itself
and how it can be displayed on a screen. There
are two important definitions here:
» Image resolution refers to the number of
pixels that make up an image; for example, an
image could contain 4096 × 3192 pixels
(12738 656 pixels in total).
» Screen resolution refers to the number of
horizontal pixels and the number of vertical
pixels that make up a screen display (for
example, if the screen resolution is smaller
than the image resolution then the whole
image cannot be shown on the screen or the
original image will now be a lower quality).
Bitmap file size
File size is always an issue with an image file.
A large file occupies more memory space and
THE GPA GYM
THE GPA GYM EDUCATION FOR ALL.

takes longer to display or to be transmitted


across a network.
A vector graphic file will have a smaller size
than a corresponding bitmap file. A bitmap
file has to store the pixel data but the file must
also have a header that defines the resolution
of the image and the coding scheme for the
pixel colour.
You can calculate the minimum size (the size
not including the header) of a bit map fi le
knowing the resolution and the colour depth.
As an example, consider that a bitmap file is
needed to fill a laptop screen where the
resolution is 1366 by 768. If the colour depth
is to be 24 then the number of bits needed is:
1366 X 768 X 24 = 25178112 bits
The result of this calculation shows the
number of bits, but a file size is always quoted
as a number of bytes or multiples of bytes.
Thus, our file size could be quoted as:
25 178 112 bits = 25178112/8

THE GPA GYM


THE GPA GYM EDUCATION FOR ALL.

= 3147 264 bytes


= 3147264/1024 = 3073.5 kibibytes (3073.5
KiB)
= 3073.5/1024 = approximately 3 MiB

Vector graphics
It is normal for an image that is created by a
drawing package or a computer-aided design
(CAD) package to consist of a few geometric
objects. The outcome is then usually for the
image to be stored as a vector graphic file.
A vector graphic file conta ins a drawing list.
The list contains a command for each object
included in the image. Each command has a
list of attributes that define the properties of
the object. The properties include the basic
geometric data such as, for a circle, the
position of the centre and its radius. In
addition properties such as the thickness and
style of a line, the colour of a line and the

THE GPA GYM


THE GPA GYM EDUCATION FOR ALL.

colour that fills the shape, if that is


appropriate, are defined.

THE GPA GYM

You might also like