Data Representation Intro
Data Representation Intro
DATA REPRESENTATION
Dr. E. Afful-Dadzie
What is Data?
■ "Information that is either digital or analogue and can be manipulated to
produce a result.“
■ There are two main categories of data: Digital Data - Data that is stored
and manipulated on a computer.
■ Analogue Data - Data which is gathered without a computer.
■ Data can exist in many forms. For example:
– Text (letters/words)
– Numbers (whole numbers, decimals, currency)
– Date
Analogue
■ Definition: "Analogue data use values that change very smoothly."
■ A good example of this is an analogue clock. An analogue clock shows the time with a
smoothly moving seconds hand. The change is continuous.
■ Sound is also a good example of analogue data. Sound waves change in a very smooth way.
■ All analogue devices use analogue data. Examples of analogue devices include:
Digital Data
■ Definition: "Digital data jumps from one value to the next in a step by step sequence
(Discrete data) .“
■ A good example of this is a digital clock. A digital clock jumps from one second to
another in clear steps. The change is not smooth or continuous.
■ The name "Digital" is given to all devices that store and process data in the form of
'digits' (numbers).
■ These digits are known as 'Binary'.
Analogue and Digital Conversion
■ There are two types of data converters:
1. Analogue to Digital Converter (ADC)
2. Digital to Analogue Converter (DAC)
■ If we try to attach an analogue device (like a microphone) to a computer we will need to
convert the analogue data to digital before the computer can use it.
■ If we want to use analogue values with a digital device or digital values with an analogue
device we need to use data conversion.
■ If we want to listen to digital music (like mp3's) we would need to attach an analogue
device such as loud speakers or headphones to our computer.
Analogue Vs Digital
■ In our everyday lives, we communicate with each other
using analogue data.
■ Analogue data is an approximation of reality; digital data
tends to be exact
■ Analogue data use values that change very smoothly.
■ Digital data jumps from one value to the next in a step by
step sequence called Discrete
Data Representation
In our everyday lives, we communicate with each other using
analogue data.
• Sound
• Images
• Letters
• Numbers
• Colours etc.
This type of data can vary and because of this, it cannot be easily
represented in a computer.
What is Binary?
■ All computer data is really a number known as a Binary Digit (often
shortened to just binary).
■ Binary is represented by the numbers 1 and 0.
■ Different combinations of these 1's and 0's are used to represent all
the different kinds of data that can be stored and processed within a
digital device (such as a computer).
■ For example:-
■ The word 'Hello' is stored as the binary combination of
0100100001100101011011000110110001101111
Data Representation
Computer - electronic device - handles binary data
Transistors represent the binary data.
• Transistor is on - binary 1
• Transistor off - binary 0.
Using transistors, binary codes are devised to represent numbers,
letters, colours, sounds etc.
In this binary system, each 0 or 1 is called a binary digit (Bit). By
placing them side by side, we can create binary codes
0 1 Bit
10 2 Bit
1011 4 Bit
10010011 8 Bit
Data Representation
If we extend this system, we could use it to represent
numbers. From the right-hand side, the binary digits
could represent the numbers 128, 64, 32, 16, 8, 4, 2,
1 etc.
Data Representation
■ Binary numbering system
– Base-2
– Built from ones and zeros
– Each position is a power of 2
1101 = 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20
■ Decimal numbering system
– Base-10
– Each position is a power of 10
3052 = 3 x 103 + 0 x 102 + 5 x 101 + 2 x 100
11
Data Representation
From the numbers example, we can see that the computer
can handle data as long as it is presented in binary form.
The analogue numbers have become digital data. If it was
possible to create codes to represent all our analogue data, it
would appear as groups of 0’s and 1’s and could be
converted to digital data.
The computer could then handle this data.
This conversion process is called digitising data:
101101001001000010010001000
RED
100001011010101010101111000
101010101010001010011111001
Is there anybody
there, said the
010100101010101010101010011
traveller, 100110010101111010100101010
knocking on the 001010101001010010100101000
100011
Data Representation
Word-procressing is the most basic type of data processing. In
Wordprocessing, the keyboard holds the character set which
includes:
Therefore:
• T4 is 2 Bytes long
• Technology is 10 Bytes long
• Introduction to Computing is ? Bytes long (the spaces count)
Data Representation
In the ASCII table, the bit sequences (codes) are listed in
Binary and each code is named according to its Decimal value:
0101010000110100
These are then converted to ASCII numbers (84 and 52) and
displayed on screen:
T4
Data Representation
Not all data can be represented as characters
To process images and sound in a computer, they must be represented
as binary codes.
If the image is zoomed, the individual pixels can be seen as either black or
white.
In a black and white image, only 1 Bit is needed to represent each pixel as
the pixel can only be black or white.
Data Representation
This is called a Bitmapped image as the bits used to represent
the image are arranged into a grid of Bits
A more complex image is shown below and the grid and map of
Bits is clearly visible:
The following table provides an example of a combination of the activities that may consume 2 GB of data in
a month -