MELJUN CORTES Data Representation

15
MELJUN P. CORTES MELJUN P. CORTES DATA REPRESENTATION Data Representation and Digital Electronics

description

MELJUN CORTES Data Representation

Transcript of MELJUN CORTES Data Representation

Page 1: MELJUN CORTES  Data Representation

MELJUN P. CORTESMELJUN P. CORTES

DATA REPRESENTATION

Data Representation and Digital Electronics

Page 2: MELJUN CORTES  Data Representation

4

• Data is defined as the symbols that represent things, people, events and ideas

• Computers store data in digital format as a series of 1s and 0s (known as binary code)– Each 1 and 0 is called a bit– Eight bits is called a byte

• The term bit comes from “binary digit”• Bytes are used to represent one character – a letter,

number, or punctuation mark– For example, the letter H is represented in binary code as

01001000– An exclamation point (!) is 001000001

Data Representation: How do computers represent data digitally?

MELJUN P. CORTESMELJUN P. CORTES

Page 3: MELJUN CORTES  Data Representation

4

• Digital data is made up of discrete numbers, with each bit being either a 1 or a 0 – it’s either on or off, nowhere in between

• Analog data is made up of a continuous wave of information, with varying degrees in between

• For example:– A digital clock changes it’s digital display

once every minute to show the time– An analog clock is continually moving it’s

second, minute and hour hands to show the time

Data Representation: How do computers represent data digitally?

MELJUN P. CORTESMELJUN P. CORTES

Page 4: MELJUN CORTES  Data Representation

4

• Another example is a light fixture– A standard light switch is similar to digital

• It is either on or off – 1 or 0

– A dimmer light switch is similar to analog

• It’s rotating dial can be turned to many different positions to make the light varying degrees of bright or dim

Data Representation: How do computers represent data digitally?

MELJUN P. CORTESMELJUN P. CORTES

Page 5: MELJUN CORTES  Data Representation

4

• Data representation makes it possible to convert letters, sounds, and images into electrical signals

• Digital electronics makes it possible for computer to manipulate simple “on” and “off” signals to perform complex tasks– A computer’s circuits have only two states: on

and off– A binary 1 represents “on”– A binary 0 represents “off”

Data Representation: How do computers represent data digitally?

MELJUN P. CORTESMELJUN P. CORTES

Page 6: MELJUN CORTES  Data Representation

6

• Unlike the decimal system (base 10), the binary number system (base 2) uses only two digits: 0 and 1

• The following table lists some decimal numbers and their binary equivalent:

How can a computer represent numbers?

MELJUN P. CORTESMELJUN P. CORTES

Page 7: MELJUN CORTES  Data Representation

7

• Character data is composed of letters, symbols, and numbers that will not be used in arithmetic operations– Numeric data is used in arithmetic calculations, and is

encoded differently

• ASCII (American Standard Code for Information Interchange) requires only 7 bits for each character

• Extended ASCII uses 8 bits for each character. Used in most personal computers– See the code on the next slide

How can a computer represent words and letters using bits?

MELJUN P. CORTESMELJUN P. CORTES

Page 8: MELJUN CORTES  Data Representation

7

How can a computer represent words and letters using bits?

MELJUN P. CORTESMELJUN P. CORTES

Page 9: MELJUN CORTES  Data Representation

8

• EBCDIC (Extended Binary-Coded Decimal Interchange Code) is an alternative 8-bit used by older IBM systems

• Unicode uses 16 bits and provides codes for 65,000 characters – a bonus for representing alphabets of multiple languages– Used for foreign language support

How can a computer represent words and letters using bits?

MELJUN P. CORTESMELJUN P. CORTES

Page 10: MELJUN CORTES  Data Representation

9

• Sounds and pictures must be transformed into a format the computer can understand

• A computer must digitize colors, notes, and instrument sounds into 1s and 0s

• For example, a red dot on your screen might be represented by 1100, a green dot by 1101

How does a computer convert sounds and pictures into codes?

MELJUN P. CORTESMELJUN P. CORTES

Page 11: MELJUN CORTES  Data Representation

9

• Data is stored on a computer in a file– Data files might contain the text of a document, the

numbers for a calculation, the contents of a web page, or the notes of a music clip as binary code

– Executable files contain the programs or instructions that tell the computer how to perform a specific task. For example, how to display and print text

• Data files have a file header which tells the computer how the binary code is used to represent the data.– The header tells the computer if the binary code represents

a music file, a graphic, a text document, etc.

How does a computer store all these codes?

MELJUN P. CORTESMELJUN P. CORTES

Page 12: MELJUN CORTES  Data Representation

10

• A bit is one binary digit (b)– Eg. 0

• A byte is 8 bits (B)– Eg. 0010 0100

• A nibble is 4 bits– Eg. 0011

Quantifying Bits and bytes: How can I tell the difference between bits and bytes?

MELJUN P. CORTESMELJUN P. CORTES

Page 13: MELJUN CORTES  Data Representation

11

• Prefixes– Kilo- means a 1000– Mega- means million– Giga- means billion

• Kilobit (Kb) is approx. 1,000 bits (1,024)• Kilobyte (KB) is approx. 1,000 bytes (1,024)• Megabyte (MB) is approx. 1,000,000 bytes

(1,048,576)• Gigabyte (GB) is approx. 1,000,000,000

bytes (1,073,741,824)

Quantifying Bits and bytes: How can I tell the difference between bits and bytes?

MELJUN P. CORTESMELJUN P. CORTES

Page 14: MELJUN CORTES  Data Representation

11

1. A(n) _______ device works with discrete numbers, whereas a(n) _______ device works with continuous data.

2. The _______ number system represents numeric data as a series of 0s and 1s.

3. Most personal computers use the _______ code to represent character data.

4. 100 Mb is larger than 100 MB. True or false?

5. A prefix that means a million bytes is _______.

Self Quiz Questions

MELJUN P. CORTESMELJUN P. CORTES

Page 15: MELJUN CORTES  Data Representation

11

1. A(n) digital device works with discrete numbers, whereas a(n) analog device works with continuous data.

2. The binary number system represents numeric data as a series of 0s and 1s.

3. Most personal computers use the extended ASCII code to represent character data.

4. 100 Mb is larger than 100 MB. False

5. A prefix that means a million bytes is Mega .

Self Quiz Answers

MELJUN P. CORTESMELJUN P. CORTES