Docsity

Data Representation - Computing System - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download Data Representation - Computing System - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Data Representation

CT101 – Computing Systems

Clickers Test

Are you there?

A. Yes

B. No

Digital vs. Analog (1)

  • Computing systems are finite machines. They store a limited

amount of information, even if the limit is very big.

  • The goal, is to represent enough of the world to satisfy our computational

needs and our senses of sight and sound.

  • 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

Digital vs. Analog (2)

• Why digital signal?

  • Both electronic signals (analog and digital) degrade as they

move down a line. The voltage of the signal fluctuates due to

environmental effects.

  • As soon as an analog signal degrades, information is lost. Since

any voltage level within the range is valid, it is impossible to

know that the original signal was even changed

  • Digital signals jump sharply between two extremes (high and

low state). A digital signal can degrade quite a bit until the

information is lost, because any value over a certain threshold is

considered high value and bellow the threshold is considered

low value

• Answer: Signal Integrity can be maintained!

Binary Representation (1)

• Why binary representation (as suppose to decimal

or octal, etc..)?

– Because the devices that store and manage the digital

data are far less expensive and complex for binary

representation.

– They are also far more reliable when they have to

represent one out of two possible values.

– Because the electronic signals are easier to maintain if

they carry only binary data.

Binary Representation (2)

• One bit can be either 0 or 1. Therefore, one bit can

represent only two things.

• To represent more than two things, we need multiple bits.

Two bits can represent four things because there are four

combinations of 0 and 1 that can be made from two bits:

• In general, n bits can represent 2

n

things because there are

n

combinations of 0 and 1 that can be made from n bits.

Note that every time we increase the number of bits by 1,

we double the number of things we can represent.

Review Question 2

How many things can a bit represent?

A. One

B. Two

C. Ten

D. I don’t know …

Review Question 3

How many things a byte can represent?

A. One

B. Two

C. 256

D. I don’t know

Why Standards?

• They exist because they are:

  • Convenient – sometimes the time to market is very important

whenever trying to finish a product, therefore existing standards

may be used to save time elaborating own protocols and

interfaces

  • Efficient – most of the standards are put together by committees

with a wide experience in the specific area

  • Flexible – usually the standards allow for manufacturer or OEM

specific extensions

  • Appropriate – address a specific problem in a specific domain

• Allow communication and sharing of information

• Allow computing systems and software to interoperate (at

both hardware and software levels)

• Sometimes standards are arbitrary and have some “blast

from the past” (due to historical evolution)

Standards Organizations

• ISO – International Standards Organization

• IEEE – Institute for Electrical and Electronics

Engineers

• CSA – Canadian Standards Association

• ANSI – American National Standards Institute

• NSAI – National Standards Authority of Ireland

Alphanumeric Data

• Three standards for representing letters (alpha) and

numbers

– ASCII – A merican S tandard C ode for I nformation

I nterchange

– EBCDIC – E xtended B inary- C oded D ecimal

I nterchange C ode (not used anymore, used to be used

in IBM mainframes)

– Unicode

Codes and Characters

• The problem:

– Representing text strings, such as

“Hello, world”, in a computer

• Each character is coded as a byte ( = 8 bits)

• Most common coding system is ASCII

• ASCII = American National Standard Code for

Information Interchange

• Defined in ANSI document X3.4-

0000 NULL DLE 0 @ P ` p 0001 SOH DC1! 1 A Q a q 0010 STX DC2 " 2 B R b r 0011 ETX DC3 # 3 C S c s 0100 EDT DC4 $ 4 D T d t 0101 ENQ NAK % 5 E U e u 0110 ACK SYN & 6 F V f v 0111 BEL ETB ' 7 G W g w 1000 BS CAN ( 8 H X h x 1001 HT EM ) 9 I Y i y 1010 LF SUB * : J Z j z 1011 VT ESC + ; K [ k { 1100 FF FS , < L \ l | 1101 CR GS - = M ] m } 1110 SO RS. > N ^ n ~ 1111 SI US /? O _ o DEL

Most significant bit

Least significant bit

0000 NULL DLE 0 @ P ` p 0001 SOH DC1! 1 A Q a q 0010 STX DC2 " 2 B R b r 0011 ETX DC3 # 3 C S c s 0100 EDT DC4 $ 4 D T d t 0101 ENQ NAK % 5 E U e u 0110 ACK SYN & 6 F V f v 0111 BEL ETB ' 7 G W g w 1000 BS CAN ( 8 H X h x 1001 HT EM ) 9 I Y i y 1010 LF SUB * : J Z j z 1011 VT ESC + ; K [ k { 1100 FF FS , < L \ l | 1101 CR GS - = M ] m } 1110 SO RS. > N ^ n ~ 1111 SI US /? O _ o DEL

i.e. ‘a’ = 1100001 2 = 97 10 = 61 16