32
LBSC 690 Session 6 Data Transformation and Representation

LBSC 690 Session 6 Data Transformation and Representation

Embed Size (px)

Citation preview

Page 1: LBSC 690 Session 6 Data Transformation and Representation

LBSC 690

Session 6

Data Transformation and Representation

Page 2: LBSC 690 Session 6 Data Transformation and Representation

Forms of Data

1. Numerical info.

2. Character or “symbol” info.

3. Visual info.

4. Audio info.

5. Streams of specially encoded digits,e.g., “ones” and “zeros.”

6. Command or instructional information.

Page 3: LBSC 690 Session 6 Data Transformation and Representation

Data Conversion

• External data may have to be transformed before computer can process it.– What form of representation is required?

• Two options:– Digital.– Analog.

Page 4: LBSC 690 Session 6 Data Transformation and Representation

Two Major Types of Computer

• Digital:– Data is expressed in discrete, specific, separate

and distinct, values:• E.g., light/light switch.

– Two states.

• Analog:– Data varies, or is expressed, as a continuous

range of values.• E.g., temperature.

Page 5: LBSC 690 Session 6 Data Transformation and Representation

Advantages of Digital

• Simplicity and reliability.– Particularly using 2 discrete states.

• Claude Shannon’s work.– Application of Boolean Logic to switching

circuits.• Use of logical operators: and, or & not.

• Truth of logical statements.

Page 6: LBSC 690 Session 6 Data Transformation and Representation

Truth Tables: A or B

A B A or B

0 0 0

1

0 1

0 1 1

1

1 1

Page 7: LBSC 690 Session 6 Data Transformation and Representation

Truth Tables: A and B

A

B A and B

0 0 0

1 0 0

0 1 0

1 1 1

Page 8: LBSC 690 Session 6 Data Transformation and Representation

Truth Tables: Not A

A not A

1 0

0 1

Page 9: LBSC 690 Session 6 Data Transformation and Representation

Boolean Algebra of Sets

• Venn Diagrams

A

B

A=Universe of all published books

B=All scientific and technical books

Page 10: LBSC 690 Session 6 Data Transformation and Representation

Boolean Algebra of Sets II

A

B CD

A=Universe of all published books.

B= All scientific and technical books

C=All books published in English.

D=“Intersection” of B & C. What does it represent?

Page 11: LBSC 690 Session 6 Data Transformation and Representation

Number Systems

• What is:– 679?– 111?

• We are accustomed to think in the decimal system.– But there are many number systems.– See transparency.

Page 12: LBSC 690 Session 6 Data Transformation and Representation

Digits

• Decimal: 0,1,2,3,4,5,6,7,8 & 9.

• Binary system: 0 & 1.

• Ternary: 0, 1, & 2.

• Octal: 0, 1, 2, 3, 4, 5, 6 & 7.

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

Page 13: LBSC 690 Session 6 Data Transformation and Representation

Binary Arithmetic

• Addition:

0+0=0

0+1=1

1+0=1

1+1=10

• Multiplication:

0x0=0

0x1=0

1x0=0

1x1=1

Page 14: LBSC 690 Session 6 Data Transformation and Representation

Definitions

• Binary digits:– Called “bits” for short.

• 8 bits, treated as a unit, are called a “byte.”

• 4 bits are called a “nibble.”

Page 15: LBSC 690 Session 6 Data Transformation and Representation

Measures

• A word is a generic term to describe a specific group of binary digits treated as a unit.– Words are measured by their length.

• The number of bits they contain.

• Registers are measured by their lengths:– The number of bits they contain.– May be organized on a word or byte basis.

Page 16: LBSC 690 Session 6 Data Transformation and Representation

Coding

• Use of binary numbers to represent symbols or characters.

• Two most widely used coding schemes:– ASCII – American Standard Code for

Information Interchange. (7 bits).• Extended ASCII.

– EBCDIC – Extended Binary Coded Decimal Interchange Code. (8 bits).

Page 17: LBSC 690 Session 6 Data Transformation and Representation

ASCII

• Handout.

• Representation Scheme: X 7 6 5 4 3 2 1

A : 1 0 0 0 0 0 1

a: 1 1 0 0 0 0 1

(Extended ASCII is used in every PC.)

Page 18: LBSC 690 Session 6 Data Transformation and Representation

Addressing

• Each memory location:– Has a unique number assigned to it – its

address.

• Example: In Intel 8086 memory is 1MB,– 1 million bytes.

• To be precise, it is 1,048,576 bytes.

• 1KB is 1024 bytes.

• Each memory location is like a mailbox.

Page 19: LBSC 690 Session 6 Data Transformation and Representation

Memory

• Contents are distinct from address.• Concept of “random” access:

– RAM, SRAM, DRAM, SDRAM, VRAM.

• Each memory byte can contain:1. Binary number,2. Binary coded decimal,3. ASCII character,4. Binary string.5. Instruction.(NOTE: Each of these is represented in memory by 1’s and

0’s).

Page 20: LBSC 690 Session 6 Data Transformation and Representation

Instruction

• Determines what operation is to be performed by computer.– Operation part.

• Provides information about location of data to be used or results to be stored.– Operand part (Address part).

Page 21: LBSC 690 Session 6 Data Transformation and Representation

Instruction Types

• Many different types; generally fall into 4 major categories:

1. Arithmetic.2. Logical.3. Editing.4. Input/Output (I/O).

– Total ensemble of instructions is called the instruction set.

Page 22: LBSC 690 Session 6 Data Transformation and Representation

Typical Instructions

• LOAD L 58 01011000(M) (R1) {Memory is unchanged,

R1 is changed.}

• ADD A 5A 01011010 (M) + (R1) (R1) {Memory unchanged,

Sum in R1.}

• STORE ST 50 01010000 (R1) (M) {Memory changed,

R1 unchanged.}

Page 23: LBSC 690 Session 6 Data Transformation and Representation

Sample Problem(Deliberately Simplistic)

• Problem Statement:– Maintain daily count of the number of radios in the

warehouse.• Method of Solution:

– Compute an arithmetic sum, defined as the NEW TOTAL, by adding two numbers, defined as TODAY’S RECEIPTS and YESTERDAY’S TOTAL. That is:

NEW TOTAL = YESTERDAY’S TOTAL + TODAY’S RECEIPTS.

NOTE: To simplify example, we have ignored SALES (shipments).

Page 24: LBSC 690 Session 6 Data Transformation and Representation

Procedure (Flow Chart)

Bring quantity representing YESTERDAY’S TOTAL from memory into the ALU.

Add to it the quantity from memory representing TODAY’S RECEIPTS.

Store resulting sum, the NEW TOTALin memory

Page 25: LBSC 690 Session 6 Data Transformation and Representation

Program

• Reference handout.• Note:

– Instructions and data are both stored in memory.• Both are represented by 0’s and 1’s.• They are in separate locations in memory.

• Program operates in cyclical fashion:– One instruction at a time.– Each instruction has two parts:

• A “fetch cycle” followed by an “execute cycle.”• Reference the handout.

Page 26: LBSC 690 Session 6 Data Transformation and Representation

Instruction Cycle: Fetch Cycle

MEMORY

CONTROL UNITInstruction CounterInstruction Register

ALURegister 1Register 2

………Register N

Page 27: LBSC 690 Session 6 Data Transformation and Representation

Instruction Cycle: Execute

MEMORY

CONTROL UNITInstruction CounterInstruction Register

ALURegister 1

Register 3

Page 28: LBSC 690 Session 6 Data Transformation and Representation

Programming

• Very much detail.

• Complexity and growth of instructions sets:– Intel 8086: 121 instructions.

– 80286: 144 “.

– 80386: 195 “.

– 80486: 201 “.

– Pentium: 289 “.

– Pentium Pro MMX: 346 “.

– Pentium III: 416 “.

Page 29: LBSC 690 Session 6 Data Transformation and Representation

Memory

• Areas of memory reserved for special functions.

• Primary high-speed memory in PCs is random access (RAM).– It is volatile.

• Certain memory segments are permanent:– Read only memory (ROM).

Page 30: LBSC 690 Session 6 Data Transformation and Representation

Interrupts

• Times when computer needs to be alerted to some situation or condition that needs to be handled expeditiously.– Interrupts are used to do this.– PIC’s.– Operating system provides services to handle

interrupts.

Page 31: LBSC 690 Session 6 Data Transformation and Representation

Classification of Computer Systems

1. SISD:• Single instruction, single data streams.

2. SIMD:• Single instruction, multiple data streams.

3. MISD:• Multiple instruction, single data streams.

4. MIMD:– Multiple instruction, multiple data streams.

Page 32: LBSC 690 Session 6 Data Transformation and Representation

Definitions

• Multiprocessors:– Two or more processing systems tightly connected

under integrated control.

• Pipelining: – Overlap or assembly-line organization.

• Computer “looks ahead” to next instructions.

• Distributed systems:– Network of computer systems.

• Loosely connected:– Client/Server.