GCSE Revison Guide - Chapter 1
GCSE Revison Guide - Chapter 1
Data Representation
Memory Units
(84 – 64 = 20 20 – 16 =4 4 - 4 = 0)
Denary to Hexadecimal
Divide by 16 - Read the remainders from the bottom up
Example: 2004
/ 16 = 7 remainder 13
/ 16 = 0 remainder 7
Binary to Denary
When calculating the value of a binary number each time a 1 appears in a column, the column value is added to
the total The 0 values are simply ignored. E.g.
Binary to Hexadecimal
Starting from the right split the number into groups of 4 bits
Example - 1 0 0 0 0 1 1 1 1 1 1 1 0 1
First split this up into groups of 4 bits:
Hexadecimal to Denary
Write the base 16 headings
Multiply each hex digit by its base heading
Add the answers together
Hexadecimal to Binary
Using Table find the 4-bit code for each digit:
Put the groups together to form the binary number:
45A=010001011010
Binary addition
Note the following key facts when carrying out addition of binary digits:
Example:
Binary shifts
The logical shift means moving the binary number to the left or to the right.
Each shift left is equivalent to multiplying the binary number by 2 and each shift right is equivalent to
dividing the binary number by 2.
As bits are shifted, any empty positions are replaced with a zero - see examples.
Problems with shifting bits
Two’s compliment
To allow the possibility of representing negative integers we make use of two's complement.
In two's complement the left-most bit is changed to a negative value.
For instance, for an 8-bit number, the value 128 is now changed to -128, but all the other headings remain
the same.
This means the new range of possible numbers is: -128 (10000000) to +127 (01111111).
It is important to realise when applying two's complement to a binary number that the left-most bit always
determines the sign of the binary number.
A 1-value in the left-most bit indicates a negative number and a 0-value in the left-most bit indicates a
positive number (for example, 00110011 represents 51 and 11001111 represents -49).
Hexadecimal Systems
Advantages
Easier to understand
Easier to debug
Shorter so takes up less space
Faster to enter than binary
Conversion to binary easier than from denary
Uses
MAC Addresses
Hardware Address
Unique number associated with a device
Usually 48/64 bits (12/16 hex digits)
First 6/8 digits = manufacturer code
Last 6/8 digits = serial number of device
UAA (Most Common)
LAA (Can be changed)
Why change MAC address
on mainframe systems all MAC addresses of devices may need to fall into a strict format
to bypass a MAC address filter on a router or a firewall
To get past certain types of network restrictions it may be necessary to emulate unrestricted MAC addresses
Error Codes
Since it is much easier to work with: B 5 A 4 1 A F C rather than: 1 0 1 1 | 1 0 0 1 | 1 0 1 0 | 0 1 0 0 | 0 0 0 1 | 1 0 1 0 |
1 1 1 1 | 1 1 0 0 hexadecimal is often used when developing new software or when trying to trace errors in
programs.
The contents of part of the computer memory can hold the key to help solve many problems.
When the memory contents are output to a printer or monitor, this is known as a MEMORY DUMP:
These numbers refer to the memory location of the error and are usually automatically generated by the
computer.
HTML Colours
Every pixel in a computer colour monitor may have only one colour at any moment
Each colour is made up of a combination of shades of red, green and blue
Each pixel stores information about its state and colour in a memory location.
hexadecimal RGB colour values that specify the amount of Red, Green and Blue light that need to appear at
a pixel, in order to produce a specific colour
Each colour value is represented as a hexadecimal value of two digits that may take up values from 00 to FF
IP Addresses
Each device connected to a network is given an address known as the Internet Protocol (IP) address
An IPv4 address is a 32-bit number written in denary or hexadecimal form: e.g. 109.108.158.1 (or
77.76.9e.01 in hex)
IPv4 has recently been improved upon by the adoption of IPv6.
An IPv6 address is a 128-bit number broken down into 16-bit chunks, represented by a hexadecimal number.
Note IPv6 uses a colon (:) rather than a decimal point (.) as used in IPv4
Use lossless
Repeated words can be indexed
Repeated words sections e.g. ‘ou’ can be replaced with numerical value
Can be saved a s a zip file
File Formats
MIDI
Mp3
File compression system for music which does not noticeably affect the quality of the sound
Removes sound humans can’t hear well
If two sounds playing at the same time the softer sound is removed
Uses perceptual music shaping
Differences between MP3 and MIDI
Mp4
MPEG-4 (MP4) files are slightly different to MP3 files. This format allows the storage of multimedia files
rather than just sound.
Music, videos, photos and animation can all be stored in the MP4 format.
Jpeg
As with MP3 format, once the image is subjected to the jpeg compression algorithm, a new file is formed
and the original file can no longer be constructed.
Jpeg will reduce the RAW BITMAP image by a factor of between 5 and 15 depending on the quality of the
original.
Jpeg relies on certain properties of the human eye and, up to a point, a certain amount of file compression
can take place without any real loss of quality.
Some computer imaging software boasts that it can produce over 40 million different colours – the human
eye is only able to differentiate about 10 million colours.
by separating pixel colour from brightness, images can be split into 8 x 8 pixel blocks, for example, which
then allows certain 'information' to be discarded from the image without causing any real noticeable
deterioration in quality.
Image Capture
Image Resolution
Resolution measures the number of pixels in a digital image or display. It is defined as width by height.
For example, the resolution of an HDTV is 1920 x 1080.
A digital photo that is 3,088 pixels wide by 2,320 pixels tall has a resolution of 3088 × 2320. Multiplying these
numbers together produces 7,164,160 total pixels. Since the photo contains just over seven million pixels, it
is considered a "7 megapixel" image.
The file size of an image is determined by the number of pixels.
In a 3-megapixel image would be 3 megapixels × 3 colours. In other words, 9 megabytes (each pixel occupies
3 bytes because it is made up of the three main colours: red, green and blue).
Colour Depth
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 6 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.
Sound Capture
Each sound wave has a frequency, wavelength and amplitude. The amplitude specifies the loudness of the
sound.
the amplitude of the sound wave is first determined at set time intervals (the sampling rate)
each sample of the sound wave is then encoded as a series of binary digits.
Increasing the number of possible values used to represent sound amplitude also increases the accuracy of
the sampled sound
Sampling
The number of bits per sample is known as the sampling resolution (also known as the bit depth).
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’.
Using a higher sampling rate or larger resolution will result in a more faithful representation of the original
sound source. However, the higher the sampling rate and/or sampling resolution, the greater the file size.
Run-length encoding
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.
Consider the following text string: 'aaaaabbbbccddddd'. Assuming each character requires 1 byte then this
string needs 16 bytes. If we assume ASCII code is being used, then the string can be coded as follows:
This means we have five characters with ASCII code 97, four characters with ASCII code 98, two characters
with ASCII code 99 and five characters with ASCII code 100.
Assuming each number in the second row requires 1 byte of memory, the RLE code will need 8 bytes. This is
half the original file size.
Using RLE Flags
One issue occurs with a string such as 'cdcdcdcdcd' where RLE compression isn't very effective.
To cope with this, we use a flag. A flag preceding data indicates that what follows are the number of
repeating units (for example, 255 05 97 where 255 is the flag and the other two numbers indicate that there
are five items with ASCII code 97).
When a flag is not used, the next byte(s) are taken with their face value and a run of 1 (for example, 01 99
means one character with ASCII code 99 follows).
The original string contains 32 characters and would occupy 32 bytes of storage.
The coded version contains 18 values and would require 18 bytes of storage.
This has 15 values and would, therefore, require 15 bytes of storage. This is a reduction in file size of about
53% when compared to the original string.
The letter ‘F’ in a grid where each square requires 1 byte of storage. A white square has a value 1 and a black
square a value of 0:
The 8 x 8 grid would need 64 bytes; the compressed RLE format has 30 values, and therefore needs only 30
bytes to store the image.
An object in four colours. Each colour is made up of red, green and blue (RGB] according to the code on the
right.
This produces the following data: 2 0 0 0 4 0 255 0 3 0 0 0 6 255 255 255 1 0 0 0 2 0 255 0 4 255 0 0 4 0 255 0
1 255 255 255 2 255 0 0 1 255 255 255 4 0 255 0 4 255 0 0 4 0 255 0 4 255 255 255 2 0 255 0 1 0 0 0 2 255
255 255 2 255 0 0 2 255 255 255 3 0 0 0 4 0 255 0 2 0 0 0.
The original image (8 x 8 square) would need 3 bytes per square (to include all three RGB values). Therefore,
the uncompressed file for this image is 8 x x = 192 bytes.
The RLE code has 92 values, which means the compressed file will be 92 bytes in size. This gives a file
reduction of about 52%.
Multiply number of pixels in vertical and horizontal directions to find total number of pixels = (1024 x 1080) =
1 105 9 20 pixels
Now multiply number of pixels by colour depth then divide by 8 to give the number of bytes= 1105920 x 32 =
35389 440/8 bytes= 4423680 bytes
Finally divide the memory stick size by the files size 68719476736 = 15 534 photos.
…………………………………………………………………………………………………………………………………………………………