0% found this document useful (0 votes)
31 views30 pages

DRO Lecture 1-1

Uploaded by

imashad97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views30 pages

DRO Lecture 1-1

Uploaded by

imashad97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Data

Representation
and Organization

5/28/2019
HNDIT1104:
Data Representation and Organization
Grade…..
Lecture 1:

Data Types and Data Representation


Learning Objectives
• At the end of the module students should be able to
 Describe difference between data and information
 Describe how computer organized the data
 Explain term bit, byte, word and different data types
 Identified the weighted and non weighted number system
 Explain weighted number system
 Identify different number systems
 Define base, number of digits and digits of that number systems

5/28/2019
1.1 Data and Information
• Data :
– collected row facts
– Cannot be used for decision making

• Information:
– Processed data
– Can be used to decision making
Data in Computing System
• Usually the computing systems are complex devices,
dealing with a vast array of information categories
• The computing systems store, present, and help us
modify:
– Text
– Audio
– Images and graphics
– Video
Digital vs. Analog
• The information can be represented in one or two ways: analog or
digital.
– Analog data is a continuous representation, analogous to the actual
information it represents.
• In example, a mercury thermometer is an analog device. The mercury rises in a
continuous flow in the tube in direct proportion to the temperature.
– Digital data is a discrete representation, breaking the information up into
separate (discrete) elements.
• Computers can’t work with analog information, so a need do digitize the analog
information arise.
• This is done by breaking the analog information into pieces and representing
those pieces using binary digits
Analog and Digital Signal

• Analog data can be represented using analog


signal
• Digital data can be represented using digital
signal
1.2 Data organization in a Computer
• Most 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

ON OFF
Represent Data in Computer
• Early computer design was decimal
– Mark I and ENIAC
• John von Neumann proposed binary data
processing (1945)
– Simplified computer design
– Used for both instructions and data
• Natural relationship between
On Off
on/off switches and
True False
calculation using Boolean logic Yes No
1 0
How do computers represent data?

• Convert analog signals to digital signals after


capturing them by the input devices
• Digital signals are represented by numbers
• ALL data must be represented in memory as
binary digits (bits)
1 1 1 1 1

0 0 0 0 0
How do we store them in a computer?
• Computer programs and data are often
represented (outside the computer) using
octal and hexadecimal number systems
because they are a short hand way of
representing binary numbers.
Basic Data Type Available in Computer
• Numeric Data
– Numbers (Integer, real)
• Non-numeric Data
– Letters, Symbols
• Alphanumeric :
• Image data
• Audio data
• Video data
Data Units use in a Computer

A bit is the most basic unit of information in a


computer.
• It is a state of “on” or “off” in a digital circuit.
• Sometimes they represent high or low voltage

A byte is a group of eight bits.. It is the smallest


possible addressable unit of computer storage.

15
2.1 Introduction

• A word is a contiguous group of bytes.


– Words can be any number of bits or bytes.
– Word sizes of 16, 32, or 64 bits are most
common.

16
 Bit: It is the smallest unit of information used in a computer system. It
can either have the value 0 or 1. Derived from the words Binary ditIT.
 Nibble: It is a combination of 4 bits.
 Byte: It is a combination of 8 bits.
 Word: It is a combination of 16 bits.
 Double word: It is a combination of 32 bits.
 Kilobyte (KB): It is used to represent the 1024 bytes of information.
 Megabyte (MB): It is used to represent the 1024 KBs of information.
 Gigabyte (GB): It is used to represent the 1024 MBs of information.
Number system
• Positional Number Systems / Weighted
Number System
• Non positional number system / non
Weighted Number System
The Non-weighted/ Non Positional
Numbers
• The non-weighted numbers are not positional
weighted .
• That are not assigned with any weight to each digit
position.
• position independent
• Ex-
– Roman number system
 Roman numerals symbols with different values: I (1), V (5), X (10),
C (50), M (100)
 Examples: I, II, III, IV, VI, VI, VII, VIII, IX
– Egyptian number system
Weighted Numbers/ Positional
Number
• The weighted numbers are those that obey the position
weighting principle
• which states that the position of each number represent a
specific weight.
• Numeric values are represented by a sequence of digit symbols.
Each digit position has a value called a weight associated with it
• Ex:
– decimal numbers
– Binary numbers
– Octal numbers
– Hexadecimal numbers
 Binary (base 2): weights in powers-of-2.
– Binary digits (bits): 0,1.

 Octal (base 8): weights in powers-of-8.


– Octal digits: 0,1,2,3,4,5,6,7.

 Hexadecimal (base 16): weights in powers-of-16.


– Hexadecimal digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.

 Base R: weights in powers-of-R.


Positional number system

Base (or radix) R number


Uses R distinct symbols for each digit
Example A R = a n-1 a n-2 ... a 1 a 0 .a -1 …a –m
V(A R) = SUM (a k * R k) for k = -m to n-1

R = 10 Decimal number system


R=2 Binary
R=8 Octal
R = 16 Hexadecimal
Polynomial Evaluation
Whole Numbers (Radix = 10):
123410 = 1  103 + 2  102 + 3  101 + 4  100

With Fractional Part (Radix = 10):


36.7210 = 3  101 + 6  100 + 7  10-1 + 2  10-2

General Case (Radix = R):


(S1S0.S-1S-2)R =
S1  R1 + S0  R0 + S-1  R -1 + S-2  R-2
Examples:
a) N = 278
r = 10 (base 10) => decimal numbers
symbol: 0, 1, 2, 3, 4, 5, 6,
7, 8, 9 (10 different symbols)
N = 278 => n = 2;
a2 = 2; a1 = 7; a0 = 8
N = anrn + an-1rn-1 + … + a1r1 + a0r0

278 = (2 x 102) + (7 x 101) + (8 x 100)

Hundreds Tens Ones


b) N = 10012
r = 2 (base-2) => binary numbers
symbol: 0, 1 (2 different symbols)
N = 10012 => n = 3;
a3 = 1; a2 = 0; a1 = 0; a0 = 1
10012 = (1 x 23)+(0 x 22)+(0 x 21)+(1 x 20)
c) N = 2638
r = 8 (base-8) => Octal numbers
symbol : 0, 1, 2, 3, 4, 5, 6, 7,
(8 different symbols)
N = 2638 => n = 2; a2 = 2; a1 = 6; a0 = 3
2638 = (2 x 82) + (6 x 81) + (3 x 80)
d) N = 26316
r = 16 (base-16) => Hexadecimal numbers
symbol : 0, 1, 2, 3, 4, 5, 6, 7, 8,
9, A, B, C, D, E, F
(16 different symbols)

N = 26316 => n = 2;
a2 = 2; a1 = 6; a0 = 3

26316 = (2 x 162)+(6 x 161)+(3 x 160)


Examples:
1. (1101.101)2
2. (572.6)8

3. (2A.8)16

4. (341.24)5
(1101.101)2
= 123 + 122 + 120 + 12-1 + 12-3
= 8 + 4 + 1 + 0.5 + 0.125 = (13.625)10
(572.6)8
= 582 + 781 + 280 + 68-1
= 320 + 56 + 2 + 0.75 = (378.75)10
(2A.8)16
= 2161 + 10160 + 816-1
= 32 + 10 + 0.5 = (42.5)10
(341.24)5
= 352 + 451 + 150 + 25-1 + 45-2
= 75 + 20 + 1 + 0.4 + 0.16 = (96.56)10
Examples
1. 953.78

2. 1011.112

3. A2F 16
953.78 = 9 x 102 + 5 x 101 + 3 x 100 + 7 x 10-1 + 8 x 10-2
= 900 + 50 + 3 + .7 + .08 = 953.78

1011.112 = 1x23 + 0x22 + 1x21 + 1x20 + 1x2-1 + 1x2-2


= 8 + 0 + 2 + 1 + 0.5 + 0.25
= 11.75

A2F 16 = 10x162 + 2x161 + 15x160


= 10 x 256 + 2 x 16 + 15 x 1
= 2560 + 32 + 15 = 2607

You might also like