Chapter 1 - Notes
Chapter 1 - Notes
Number systems
1. Binary systems
The binary number system is a base 2 number system. It is based on the number 2. Thus, only the two
‘values’ 0 and 1 can be used in this system.
2. Denary systems
Denary uses ten separate digits, 0-9, to represent all values. Denary is known as a base 10 number
system.
3. Hexadecimal system
Hexadecimal (sometimes referred to as simply ‘hex’) is a base 16 system and therefore needs to use 16
different ‘digits’ to represent each value.Because it is a system based on 16 different digits, the numbers 0
to 9 and the letters A to F are used to represent each hexadecimal (hex) digit. A in hex = 10 in denary, B =
11, C = 12, D = 13, E = 14 and F = 15
Since 16 = 24 this means that FOUR binary digits are equivalent to each hexadecimal digit. The following
table summarises the link between binary,hexadecimal and denary:
HTTPS://WWW.YOUTUBE.COM/@86WAQARKHAN 1
COMPUTER SCIENCE O LEVELS - 2210
• Media Access Control (MAC) address refers to a number which uniquely identifies a device on a
network.
• The MAC address refers to the network interface card (NIC) which is part of the device.
• The MAC address is rarely changed so that a particular device can always be identified no matter
where it is.
• A MAC address is usually made up of 48 bits which are shown as 6 groups of two hexadecimal
digits (although 64-bit addresses also exist):
NN – NN – NN – DD – DD – DD
or
NN:NN:NN:DD:DD:DD
• where the first half (NN – NN – NN) is the identity number of the manufacturer of the device and
the second half (DD – DD – DD) is the serial number of the device.
• For example:
00 – 1C – B3 – 4F – 25 – FE is the MAC address of a device produced by the Apple Corporation
HTTPS://WWW.YOUTUBE.COM/@86WAQARKHAN 2
COMPUTER SCIENCE O LEVELS - 2210
• An IPv6 address is a 128-bit number broken down into 16-bit chunks, represented by a
hexadecimal number.
For example:
a8fb:7a88:fff0:0fff:3d21:2085:66fb:f0fa
• Note IPv6 uses a colon (:) rather than a decimal point (.) as used in IPv4.
Compares the features of MAC addresses and IP addresses:
HTTPS://WWW.YOUTUBE.COM/@86WAQARKHAN 3
COMPUTER SCIENCE O LEVELS - 2210
This can then be extended to consider the addition of three binary digits:
This addition has generated a 9th bit. The 8 bits of the answer are 0 1 0 0 1 1 0 0 – this gives the denary value (64 + 8 + 4) of 76
which is incorrect because the denary value of the addition is 110 + 222 = 332.
The maximum denary value of an 8-bit binary number is 255 (which is 28 – 1). The generation of a 9th bit is a clear indication
that the sum has exceeded this value. This is known as an overflow error and in this case is an indication that a number is too
big to be stored in the computer using 8 bits
For example, a 16-bit register would allow a maximum denary value of 65 535 (i.e. 216 – 1) to be stored, a 32-bit register would
allow a maximum denary value of 4 294 967 295 (i.e. 232 – 1), and so on.
HTTPS://WWW.YOUTUBE.COM/@86WAQARKHAN 4
COMPUTER SCIENCE O LEVELS - 2210
HTTPS://WWW.YOUTUBE.COM/@86WAQARKHAN 5
COMPUTER SCIENCE O LEVELS - 2210
• Notice the sixth bit changes from 1 to 0 when comparing lower and uppercase characters. This
makes the conversion between the two an easy operation.
• ASCII code has a disadvantage that it does not represent characters in non-Western languages, for
example Chinese characters.
• Extended ASCII uses 8-bit codes (128 to 255 in denary or 80 to FF in hex). This allows for non-
English characters and for drawing characters to be included.
Unicode
• Unicode can represent all languages of the world, thus supporting many operating systems, search
engines and internet browsers used globally.
• It produce a more efficient coding system than ASCII.
• Adopt uniform encoding where each character is encoded as 16-bit or 32-bit code.
• Reserve part of the code for private use to enable a user to assign codes for their own characters
and symbols (useful for Chinese and Japanese character sets, for example).
Representation of sound
Soundwaves are vibrations in the air. The human ear senses these vibrations and interprets them as
sound.
Each sound wave has a frequency, wavelength and amplitude. The amplitude specifies the loudness of the
sound.
HTTPS://WWW.YOUTUBE.COM/@86WAQARKHAN 6
COMPUTER SCIENCE O LEVELS - 2210
Sound waves vary continuously. This means that sound is analogue. Computers cannot work with
analogue data, so sound waves need to be sampled in order to be stored in a computer. Sampling means
measuring the amplitude of the sound wave. This is done using an analogue to digital converter (ADC).
The amplitude of the sound cannot be measured precisely, so approximate values are stored.
At time interval 1, the approximate amplitude is 10; at time interval 2, the approximate amplitude is 4,
and so on for all 20 time intervals. Because the amplitude range in Figure 1.9 is 0 to 10, then 4 binary bits
can be used to represent each amplitude value (for example, 9 would be represented by the binary value
1001).
sampling resolution – the number of bits used to represent sound amplitude in digital sound recording
(also known as bit depth)
or
bit depth – the number of bits used to represent the smallest unit in a sound file.
In our example, the sampling resolution is 4 bits.Sampling rate is the number of sound samples taken
per second. This is measured in hertz (Hz), where 1 Hz means ‘one sample per second’.
HTTPS://WWW.YOUTUBE.COM/@86WAQARKHAN 7
COMPUTER SCIENCE O LEVELS - 2210
The benefits and drawbacks of using a larger sampling resolution when recording sound
Benefits Drawbacks
larger dynamic range produces larger file size
takes longer to transmit/download
better sound quality
music files
less sound distortion requires greater processing power
Pixel – derived from the term 'picture element', this is the smallest element used to make up an image on
a display.
Each pixel can be represented as a binary number, and so a bitmap image is stored in a computer as a
series of binary numbers, so that:
» a black and white image only requires 1 bit per pixel – this means that each pixel can be one of two
colours, corresponding to either 1 or 0
» if each pixel is represented by 2 bits, then each pixel can be one of four colours (22 = 4), corresponding
to 00, 01, 10, or 11
» if each pixel is represented by 3 bits then each pixel can be one of eight colours (23 = 8), corresponding
to 000, 001, 010, 011, 100, 101, 110, 111.
The number of bits used to represent each colour is called the colour depth.
An 8 bit colour depth means that each pixel can be one of 256 colours (because 28 = 256).
Modern computers have a 24 bit colour depth, which means over 16 million different colours can be
represented With x pixels, 2x colours can be represented as a generalisation. Increasing colour depth also
increases the size of the file when storing an image.
Image resolution refers to the number of pixels that make up an image; for example, an image could
contain 4096 × 3072 pixels (12 582 912 pixels in total).
The main drawback of using high resolution images is the increase in file size.
As the number of pixels used to represent the image is increased, the size of the file will also increase.
HTTPS://WWW.YOUTUBE.COM/@86WAQARKHAN 8
COMPUTER SCIENCE O LEVELS - 2210
It also impacts on the time to download an image from the internet or the time to transfer images from
device to device.
bitmap image – an image made up of pixels
pixelated (image) – this is the result of zooming into a bitmap image; on zooming out the pixel density
can be diminished to such a degree that the actual pixels themselves can be seen
pixel density – number of pixels per square inch
Data storage and file compression
Measurement of data storage
• A bit is the basic unit of all computing memory storage terms and is either 1 or 0.
• The word comes from binary digit.
• The byte is the smallest unit of memory in a computer.
• 1 byte is 8 bits.
• A 4-bit number is called a nibble – half a byte.
Memory size using denary values
The above system of numbering now only refers to some storage devices but is technically inaccurate. It
is based on the SI (base 10) system of units where 1 kilo is equal to 1000.
IEC memory size system
HTTPS://WWW.YOUTUBE.COM/@86WAQARKHAN 9
COMPUTER SCIENCE O LEVELS - 2210
This system is more accurate. Internal memories (such as RAM and ROM) should be measured using the
IEC system. A 64GiB RAM could, therefore, store 64 × 230 bytes of data (68719476736 bytes).
Data compression
Sound and image files can be very large. It is therefore necessary to reduce (or compress) the size of a
file for the following reasons:
» to save storage space on devices such as the hard disk drive/solid state drive
» to reduce the time taken to stream a music or video file
» to reduce the time taken to upload, download or transfer a file across a network
» the download/upload process uses up network
Bandwidth – this is the maximum rate of transfer of data across a network, measured in kilobits per
second (kbps) or megabits per second (Mbps).
This occurs whenever a file is downloaded, for example, from a server. Compressed files contain fewer
bits of data than uncompressed files and therefore use less bandwidth, which results in a faster data
transfer rate.
» reduced file size also reduces costs. For example, when using cloud storage, the cost is based on the size
of the files stored. Also an internet service provider (ISP) may charge a user based on the amount of data
downloaded.
HTTPS://WWW.YOUTUBE.COM/@86WAQARKHAN 10
COMPUTER SCIENCE O LEVELS - 2210
Lossy files are smaller than lossless files which is of great benefit when considering storage and data
transfer rate requirements.
Common lossy file compression algorithms are:
» MPEG-3 (MP3) and MPEG-4 (MP4)
» JPEG.
MPEG-3 (MP3) (MP4)
A lossy file compression method used for music A lossy file compression method used for
files multimedia files
MP3 files are used for playing music on computers This format allows the storage of multimedia
or mobile phones. This compression technology files rather than just sound – music, videos,
will reduce the size of a normal music file by about photos and animation can all be stored in the
90%. MP4 format.
Q. How can the original music file be reduced by 90% while still retaining most of the music
quality?
Essentially the algorithm removes sounds that the human ear can’t hear properly. For example:
» removal of sounds outside the human ear range.
» if two sounds are played at the same time, only the louder one can be heard by the ear, so the softer
sound is eliminated. This is called perceptual music shaping.
JPEG
JPEG – from Joint Photographic Expert Group; a form of lossy file compression used with image files
which relies on the inability of the human eye to distinguish certain color changes and hues
HTTPS://WWW.YOUTUBE.COM/@86WAQARKHAN 11
COMPUTER SCIENCE O LEVELS - 2210
Lossy
- A (compression) algorithm is used which removes redundant/unnecessary data from the file.
- It also rremoves sounds that cannot be heard by the human ear/background noise
- Reduces sample rate and sample resolution.
- Data is permanently removed // original file cannot be re-instated
- Perceptual music shaping is used
Lossless:
- A (compression) algorithm is used in which repeating patterns are identified and are replaced with a
value or indexed
- No data is permanently removed and original file can be re-instated
- Example of a lossless algorithm is RLE – Run length encoding.
Run length Encoding (RLE) – a lossless file compression technique used to reduce the size of text and
photo files in particular
» it is a form of lossless/reversible file compression.
» it reduces the size of a string of adjacent, identical data (e.g. repeated colours in an image)
» a repeating string is encoded into two values:
– the first value represents the number of identical data items (e.g. characters) in the run.
– the second value represents the code of the data item (such as ASCII code if it is a keyboard character).
» RLE is only effective where there is a long run of repeated units/bits.
HTTPS://WWW.YOUTUBE.COM/@86WAQARKHAN 12