Professional Documents
Culture Documents
CH01 - Data Representation
CH01 - Data Representation
Introduction
Data Representation
Chapter 1
Number systems
• In our daily lives we mostly use a denary number system. This is called a
base-10 number system and uses the digits 0–9. The units in a denary
number system are ones, tens, hundreds and thousands. Each time the
unit increases by the power of 10.
• This is also called a base-2 number system and uses the digits 0 and 1.
The units in a binary number system increase by the power of 2. Any
denary values need to be converted to binary values so that they can be
processed by a computer.
Hexadecimal
• Hexadecimal is also a number system. Humans can use hexadecimal, but
computers cannot process it. Like denary numbers, hexadecimal numbers
also need to be converted to binary to be processed by a computer.
9 1111000010101111 9 20B
10 1000011101100001 10 ABCD
• Binary addition
• You need to be able to add together two 8-bit binary numbers. When binary numbers
are added together there are four rules that you will need to use:
• Rule 1 is 0 + 0 = 0
• Rule 2 is 1 + 0 = 1
• Rule 3 is 1 + 1 = 10 (this is because 10 in binary is 2)
• Rule 4 is 1 + 1 + 1 = 11 (this is because 11 in binary is 3)
• You can apply these rules to add the binary numbers 10010100 and
00011110.
1 1 0 1 1 1 0 0
1 1 0 1 1 1 0 1
• If the computer is informed that the image that should be created using
this data is 9 pixels wide and 10 pixels high, it can set each pixel to black
or white and create the image (See Figure 1.2). The type of data that is
used to provide information, such as the dimensions and resolution of an
image, is called metadata.
• Each image has a resolution and a colour depth. For example, each colour
could be represented using 8-bit, 16-bit or 32-bit binary numbers (see
Figure 1.3). The greater the number of bits, the greater the range of
colours that can be represented.
• If you recorded the sound at each time sample, you would have the
following set of values:
• The quality of the digital sound depends on the sample rate, which is
the number of samples taken per second. A higher sample rate results in
a more accurate representation of the original sound wave, but also increases
the file size of the digital sound. Sample rates are measured in hertz. 1 hertz is
equal to 1 sample per second. A common sample rate is 44.1 khz (kilohertz), this
would require 44 100 samples to be taken each second.
• The sample resolution is another factor that affects the quality of the digital
sound. This refers to the number of bits per sample, which determines the level
of detail and accuracy of each sample
• A higher sample resolution results in a more accurate representation of the
sound wave, but also increases the file size of the digital sound.
• The common sample resolution is 16-bit.
Data compression
• You may already have experience of having large files and struggling to
have enough storage space to store them. One thing that can be done to
reduce the size of a file is compression. Compressing a file will reduce
the size of the file that can have several benefits, such as:
• Not as much storage space is needed to store the file.
• It will take less time to transmit the file from one device to another.
• It will be quicker to upload and download the file.
• Not as much bandwidth is needed to transmit the file over the internet
• There two type of compression that can be used, lossy and lossless.
• Lossy compression uses a compression algorithm that finds the unnecessary and
redundant data in the file. This data is permanently removed from the file. This type
of compression is mainly used on an image file or a sound file.
• Lossless compression uses a compression algorithm to reduce the size of the file,
without permanently removing any data. A common method that can be used to do
this is by finding repeating data in the file and grouping this data together.