Transforming Data Into Information: Syed Mohsin Ali Sheerazi
Transforming Data Into Information: Syed Mohsin Ali Sheerazi
Information
Lecture 03
Syed Mohsin Ali Sheerazi
Outline
• Data Organization
• Numbering Systems
• Floating Point Representation
• BCD Representation
• Characters
• Error Detection & Correction
• Representing Colors
• Audio
Data Organization
Bits
– A bit is the fundamental unit of computer storage
– A bit can be 0 (off) or 1 (on)
– Related bits are grouped to represent different
types of information such as numbers, characters,
pictures, sound, instructions
Binary BCD Hex
0000 0 0
0001 1 1
0010 2 2
0011 3 3
• Nibbles 0100 4 4
0101 5 5
– A nibble is a group of 4 bits
0110 6 6
– A nibble is used to represent 0111 7 7
a digit in Hex (from 0-15) 1000 8 8
and BCD (from 0-9) numbers 1001 9 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
Bytes
Bytes
– A byte is a group of 8 bits that is used to represent
numbers and characters
Bytes
– How many different combinations of 0’s and 1’s
with 8 bits can be formed?
– In general, how many different combinations of 0’s
and 1’s with N bits can be formed?
– How many different characters can be represented
with a byte (8 bits)?
Words
Words
– A word is a group of 16 bits or 2 bytes
Double Words
– A double word is a group of 32 bits or 4 bytes or 2
words
Related Bytes
Storage
The Information Processing Cycle
New
Document
Data
Input Process Output
Stored Data
What coding schemes are used to
form meaningful bytes of data?
• The coding scheme ASCII (As-key) and
ASCII-8 or extended ASCII has been
adopted as a standard by the US
government and by computer
manufacturers.
• ASCII can have 128 combinations of 7 bits
each while ASCII-8 can have as many as
1256 combinations
Numbering Systems
= 8 + 4 + 0 + 1 = 13
Binary Code
• Sign-Magnitude System
• 1’s Complement System
• 2’s Complement System
Signed and Magnitude
5-bit Sign
Decimal
and Magnitude
+5 00101
-5 10101
+13 01101
-13 11101
Signed and Magnitude in 4 bits
0 0000 -0 1000
1 0001 -1 1001
2 0010 -2 1010
3 0011 -3 1011
4 0100 -4 1100
5 0101 -5 1101
6 0110 -6 1110
7 0111 -7 1111
Examples
• Positive numbers:
– same as in unsigned binary system
– pad a 0 at the leftmost bit position
• Negative numbers:
– convert the magnitude to unsigned binary system
– pad a 0 at the leftmost bit position
– complement every bit
Examples of 1’s Complement
• Positive numbers:
– same as in unsigned binary system
– pad a 0 at the leftmost bit position
• Negative numbers:
– convert the magnitude to unsigned binary system
– pad a 0 at the leftmost bit position
– complement every bit
– add 1 to the complement number
Examples of 2’s Complement
0000 0 1000 8
0001 1 1001 9
0010 2 1010 A
0011 3 1011 B
0100 4 1100 C
0101 5 1101 D
0110 6 1110 E
0111 7 1111 F
Convert Binary to Hex
Binary Hex
1111 0110b F6h
1011011b 5Bh
Addition and Subtraction in Sign and
Magnitude
(a) 5 0101
+2 +0010
7 0111
(b) -5 1101
-2 +1010
-7 1111
(c) 5 0101
-2 +1010
3 0011
(d) -5 1101
+2 +0010
-3 1011
2.5 Floating-Point Representation
Floating-Point Representation
– ASCII
– Used to represent characters and control information
– Each character is represented with 1 byte
• upper and lower case letters: a...z and A...Z
• decimal digits -- 0,1,…,9
• punctuation characters -- ; , . :
• special characters --$ & @ / {
• control characters -- carriage return (CR) , line feed (LF), beep
Examples of ASCII Code
S 83 (decimal) , 53 (hex)
8 56 (decimal) , 38 (hex)
ASCII Code in Binary and Hex
48
• Hamming codes and Reed-Soloman codes are
two important error correcting codes.
• Reed-Soloman codes are particularly useful in
correcting burst errors that occur when a series
of adjacent bits are damaged.
– Because CD-ROMs are easily scratched, they employ a type
of Reed-Soloman error correction.
• Because the mathematics of Hamming codes is
much simpler than Reed-Soloman, we discuss
Hamming codes in detail.
49
• Checksums and CRCs are examples of
systematic error detection.
• In systematic error detection a group of error
control bits is appended to the end of the block of
transmitted data.
– This group of bits is called a syndrome.
• CRCs are polynomials over the modulo 2
arithmetic field.
The mathematical theory behind modulo 2 polynomials
is beyond our scope. However, we can easily work with
it without knowing its theoretical underpinnings.
50
What are the advantages of using
computers for data processing?
• Faster data input, processing and
retrieval
• Tireless--can work 24 hours a day, 7
days a week
• Less prone to error
• Produce output requirements easily
• Could send and retrieve data from
other computers if in a network