Data Representation Lecture
Data Representation Lecture
2
Content
3
1. Data and Information
Related terms
What is a System?
• A set of components get together for a particular purpose / to deliver
a common service
• A system has inputs, which will be processed and produced as
output Data Information
What is an InformationProcess
System?
(by software)
• IS is a computer based system to deliver information
• Input: Data
Information System
• Output: Information
4
1. Data and Information
Related terms
Software Engineering
• The engineering discipline of constructing Information
Systems
5
1. Data and Information
Saman Maths 60
• Information is the processed Kamal Maths 100
outcome of data. Nuwan Maths 40
– It is derived from data Saman English50
Kamal English 70
Nuwan English 80
6
1. Data and Information
What is Information?
• Information provide meaningful values to the
receiver
Timely - Information should be available when required
Accuracy - Information should be correct
Completeness - Information should be complete
7
2. Data Types
Qualitative vs. Quantitative Data
• Quantitative Data : Numerical Information
• Qualitative Data : Descriptive data
9
2. Data Types
Character Data
Alpha-numerical
DIT451789#, ……..
10
2. Data Types
Summary
Data types
Numerical Textual
Alphabetical
Numerical
Alphabetical
Special Alphanumerical
11
2. Data Representation
12
2. Data Representation
13
3. Data Representation in Computers
How do computers represent data?
• Computers are digital
– Recognize only two discrete states: on or off
– Computers are electronic devices powered by electricity,
which has only two states, on or off
– Binary number system (0,1) is used for processing
1 1 1 1 1
0 0 0 0 0
15
3. Data Representation in Computers
How do we store data in a computer?
16
3. Data Representation in Computers
Binary number system
• The memory is made up of BITS and BYTES
• Single bit can hold a binary digit (0 or 1)
•8 Bits = 1 Byte
210 = 1024
•1024 Bytes = 1KB
•1024 KB = 1 MB 104 KB: Kilobyte (KB or Kbyte)
•1024 MB = 1 GB 50 Mbps: Megabits/sec
•1024 GB = 1 TB
Terminology related to bits and bytes is
extensively used to describe storage capacity and
network access speed.
17
3. Data Representation in Computers
Binary number system
• Each BYTE can be addressed uniquely
• When the address is expressed in Binary, the number of
maximum BITs used to write the address specifies the total
number of locations available
• If n number of BITs are available then the total number of
locations available is 2n
• If we have 32 BITs then we can have 4GB of Memory (232
= 4 GB)
19
3. Data Representation in Computers
ASCII (American Standard Code for Information Interchange)
ASCII
– 7 bit code for all 128 characters
– A=1000001
– Fundamentally, computers just deal with numbers. The letters
and other characters are stored by assigning a number for each
one
Extended ASCII
– This system is an 8-bit system and allows the system to store up
to 256 different characters
20
3. Data Representation in Computers
ASCII
21
3. Data Representation in Computers
Unicode
• Unicode provides a unique number for every character
– no matter what the platform
– no matter what the program
– no matter what the language
23
4. Error checking
Parity
• The parity is used in error checking, to find errors that
may occur during data storing/transmission
• A parity bit is a single bit added to a binary data
transmission used to indicate if whether the 0's and 1's
within that data transmission is an even or odd number
24
4. Error checking
Parity
• There are two modes of parity
– Odd parity:- The number of 1-bits (including the parity bit) must
be an odd number
– Even parity:- The number of 1-bits (including the parity bit) must
be an even number
• A single bit is appended to each data chunk (either as the
least or most significant bit)
– Makes the number of 1 bits even/odd
26
4. Error checking
Parity – Example2
• Assume we are using even parity with 7-bit ASCII.
• The letter V in 7-bit ASCII is encoded as 0110101.
27
4. Error checking
Parity – Exercises
• Add the odd parity bit as the least significant bit for the
following data
– 0100101 (0)
– 1101101 (0)
– 1011001 (1)
(0)
– 0011010
(1)
– 1111011
28
4. Error checking
Parity – Exercises
• Verify the correctness of the following data with the even
parity bit on the most significant bit
– 01010001 Wrong
– 10100101 Correct
– 01101101 Wrong
Correct
– 01111011
Correct
– 10011010
29
5. Data Compression
31
Thank You
Lecture 03
Computer Architecture