chapter 2 processing data

71
Chapter 2 Processing Data Dept. of Computer Engineering Khon Kaen University

Upload: cael

Post on 22-Jan-2016

56 views

Category:

Documents


2 download

DESCRIPTION

Chapter 2 Processing Data. Dept. of Computer Engineering Khon Kaen University. Major Concepts. Data vs. information Why a computer uses the binary number How a computer processes data CPU Memory Factors that affect processing speed CPUs used in modern personal computers - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 2  Processing Data

Chapter 2 Processing Data

Dept. of Computer Engineering

Khon Kaen University

Page 2: Chapter 2  Processing Data

Major Concepts Data vs. information Why a computer uses the binary number How a computer processes data

CPU Memory

Factors that affect processing speed CPUs used in modern personal

computers Connecting to external devices

Page 3: Chapter 2  Processing Data

Data Information Computer devices can only recognize

two distinct states produced by electricity, magnetic polarity, or reflected light All they can understand: on or off

The CPU consists of several millions tiny electronic switches called transistors.

In the strictest sense, data consists of raw numbers that computer programs turn this data into useful information

Page 4: Chapter 2  Processing Data

How a Computer Represents Data

To a computer, everything is a number

Represented as

0 0000 0000 1 0000 0001 2 0000 0010 3 0000 0011

For computer, the word “are” is represented by

Represented as a 0110 0001 r 0111 0010 e 0110 0101

Page 5: Chapter 2  Processing Data

Number Bases A number base is a specific collection

of symbols on which a number system can be built

The number base familiar to us is base 10, upon which the decimal number is built. There are ten symbols, 0 through 9 What do we do to represent a number

greater than 9? Each symbol in a number is called a digit

Page 6: Chapter 2  Processing Data

Number Bases (Cont.) Besides base 10 (the decimal

number), other number systems are The binary number system: base 2

Numbers: 0, 1 The octal number system: base 8

Numbers: 0, 1, 2, 3, 4, 5, 6, 7 The hexadecimal number system: base

16 Numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c,

d, e, f

Page 7: Chapter 2  Processing Data

Number Base Systems

Decimal (Base 10)

Binary (Base 2)

Octal (Base 8)

Hexadecimal (Base 16)

0 000 1 1

1 001 2 2

2 010 3 3

3 011 4 4

4 100 5 5

Page 8: Chapter 2  Processing Data

Number Base Systems (Cont.)

Decimal (Base 10)

Binary (Base 2)

Octal (Base 8)

Hexadecimal (Base 16)

10 1010 12 a

11 1011 13 b

12 1100 14 c

13 1101 15 d

14 1110 16 e

Page 9: Chapter 2  Processing Data

Number Base Systems (Cont.)

Decimal (Base 10)

Binary (Base 2)

Octal (Base 8)

Hexadecimal (Base 16)

10 1010 12 a

11 1011 13 b

12 1100 14 c

13 1101 15 d

14 1110 16 e

Page 10: Chapter 2  Processing Data

Number Base Systems (Cont.)

Decimal (Base 10)

Binary (Base 2)

Octal (Base 8)

Hexadecimal (Base 16)

16 10000 20 10

17 10001 21 11

18 10010 22 12

19 10011 23 13

20 10100 24 14

Page 11: Chapter 2  Processing Data

Major Concepts Data vs. information Why a computer uses the binary number How a computer processes data

CPU Memory

Factors that affect processing speed CPUs used in modern personal

computers Connecting to external devices

Page 12: Chapter 2  Processing Data

Numbers in a Computer In a computer, all data must be reduced to

electrical switches A switch has only two states – “ON” or “OFF” It has only two numeric symbols 0 stands for “OFF” and 1 stands for “ON”

Computers function in a binary number system (base 2)

When a computer needs to represent a quantity greater than 1, it uses more than one digit

Page 13: Chapter 2  Processing Data

Bits and Bytes When referring to computerized data,

each switch – whether on or off – is called bit The term bit is a contraction of binary

digit A bit is the smallest possible unit of data

To represent anything meaningful – that is to convey information The computer needs groups of bits The larger unit of data is byte, which is a

group of 8 bits

Page 14: Chapter 2  Processing Data

Bytes With one byte (8 binary digits), the

computer can represent up to 256 different values 0 to 255

One byte combination is an enough unit to represent all the English characters on the keyboard Including all letters (uppercase and

lowercase), numbers, punctuation marks, and other symbols

Page 15: Chapter 2  Processing Data

Text Codes The programmers need a standard

code which is a group of numbers to represent or standard for letters of the alphabets, punctuation marks, and other symbols

Three of the most popular systems are EBCDIC ASCII Unicode

Page 16: Chapter 2  Processing Data

EBCDIC EBCDIC: Extended Binary Coded

Decimal Interchange Code EBCDIC was defined by IBM

Eight-bit code can define 256 symbols Used in IBM mainframe and mid-range

systems Rarely encountered in personal

computers because EBCDIC makes the coding difficult and miss some characters, such as []\

Page 17: Chapter 2  Processing Data

EBCDIC Characters

Code

Dec Binary Code

Dec Binary

A 193 1100 0001

a 129 1000 0001

I 201 1100 1001

i 137 1000 1001

J 209 1101 0001

j 145 1001 0001

R 217 1101 1001

r 153 1001 1001

S 226 1110 0010

s 162 1010 0010

T 227 1100 0011

t 163 1010 0011

Page 18: Chapter 2  Processing Data

ASCII American Standard Code for

Information Interchange ASCII is the seven bits code

Specify characters up to 127 ASCII is the most common character set

It is easy to write code to manipulate upper/lowercase letters

It is also easy to check for valid data ranges

Page 19: Chapter 2  Processing Data

ASCII CharactersCode

Dec Binary Code

Dec Binary

A 65 0100 0001

a 97 0110 0001

I 73 0100 1001

i 105 0110 1001

J 74 0100 1010

j 106 0110 1010

R 82 0101 0010

r 114 0111 0010

S 83 0101 0011

s 115 0111 0011

T 84 0101 0100

t 116 0111 0100

Page 20: Chapter 2  Processing Data

UNICODE UNICODE provides a unique number for

every character No matter what the platform, the program,

and the language UNICODE represents each symbol by two

bytes – 16 bits (represents up to 65536) The UNICODE standard has been

adopted by several industry leaders and is required by modern standards, such as XML

Page 21: Chapter 2  Processing Data

UNICODE Characters

Code

Hex Code Hex Code Hex

ก 0E01 a 0061

A 0041

ข 0E02 b 0062

B 0042

ฃ 0E03 c 0063

C 0043

ค 0E04 d 0064

D 0044

ฅ 0E05 e 0065

E 0045

ฆ 0E06 f 0066

F 0046

Page 22: Chapter 2  Processing Data

Major Concepts Data vs. information Why a computer uses the binary number How a computer processes data

CPU Memory

Factors that affect processing speed CPUs used in modern personal

computers Connecting to external devices

Page 23: Chapter 2  Processing Data

How a Computer Processes Data

There are two components which handle processing data The central processing unit, or CPU The memory

Both components are located on the computer main system board (mother board)

Page 24: Chapter 2  Processing Data

The CPU The CPU is the brain of the

computer, where data is manipulated

In a microcomputer, the entire CPU is contained on a tiny chip called microprocessor

The chip has at least two basic parts The control unit The arithmetic logic unit

Page 25: Chapter 2  Processing Data
Page 26: Chapter 2  Processing Data

The Control Unit The CPU’s instructions for carrying out

commands are built into the control unit Each instruction in the instruction set is

expressed in microcode- a series of basic directions that tell the CPU how to execute more complex operations

The control unit dictates how  and  when  each  specific instruction  is  to  be performed.

Page 27: Chapter 2  Processing Data

The Arithmetic Logic Unit (ALU)

Since all computer data is stored as numbers, the computer needs a unit that carries out mathematic operations

The ALU can perform two types of operations Arithmetic operations Logical operations

Page 28: Chapter 2  Processing Data

The ALU (Cont.) When the control unit encounters an

instruction that involves arithmetic or logic, it passes that instruction to the ALU

The ALU includes a group of registers What is a register?

A high speed memory built directly inside the CPU

Hold the data currently being processed

Page 29: Chapter 2  Processing Data

Arithmetic Operations

Symbol Operations+ Add

- Subtract

x Multiply

/ Divide

^ Raise by a power

Page 30: Chapter 2  Processing Data

Logical Operations

Symbol Operations= Equal

<>, != Not equal

> Greater than

>= Greater than or equal

< Less than

<= Less than or equal

~, ! Not

Page 31: Chapter 2  Processing Data

Memory The CPU cannot store large sets of data or

entire programs permanently The CPU has only small space of its

memory (registers) The CPU needs millions of bytes of

memory for holding programs and data being manipulated The CPU needs memory (an electronic chip)

Two types of built-in memory Permanent – nonvolatile Non-permanent – volatile

Page 32: Chapter 2  Processing Data

Memory (Cont.)

Page 33: Chapter 2  Processing Data

ROM ROM stands for Read-Only Memory

The computer users can only read data but cannot write data into the memory

ROM: nonvolatile memory chips When a computer is turned off, the

content of the memory is still there Many kinds of ROM

EPROM: Erasable-Programmable ROM EEPROM: Electrically EPROM

Page 34: Chapter 2  Processing Data

RAM RAM stands for Random-Access

Memory Data can be read and changed by

computer users RAM is volatile

When a computer is turned off, the memory content disappears

RAM consists of some chips on a small circuit board

Page 35: Chapter 2  Processing Data

RAM Chips

Page 36: Chapter 2  Processing Data

RAM Technologies Fast Page Mode (FPM) RAM: the

oldest Extended Data Output (EDO) RAM:

faster than FPM Burst Extended Data Output (BEDO)

RAM: fast, but can be used in a specific computer brand

Synchronous Dynamic RAM (SDRAM): fast and used in modern CPUs

Page 37: Chapter 2  Processing Data

RAM Technologies (Cont.)

Double Data-Rate Synchronous RAM (DDR SDRAM or DDR): The fastest

Memory chips are usually grouped together on small circuit boards Single In-line Memory Module (SIMM) Double In-line Memory Module (DIMM)

SIMMs have a row of memory on one side of the board, but DIMMs have a row of memory on both sides of the board

Page 38: Chapter 2  Processing Data

Accessing the Data in Memory

The CPU stores and retrieves each piece of data using memory address

Memory address is a number indicates a location on the memory chips

Memory addresses start at zero and go up to one less than the number of bytes of memory

Page 39: Chapter 2  Processing Data

Memory AccessTo request a byte of data, the CPU sends a memory address to RAM

Page 40: Chapter 2  Processing Data

Major Concepts Data vs. information Why a computer uses the binary number How a computer processes data

CPU Memory

Factors that affect processing speed CPUs used in modern personal

computers Connecting to external devices

Page 41: Chapter 2  Processing Data

Factors Affecting Processing Speed

Computing power of the computer: the speed with which the computer processes data

Several reasons that the computer speed increases The less distance between transistors inside CPU The faster CPU’s register The more powerful memory and the cache memory The faster clock speed The wider data bus The faster math coprocessor

Page 42: Chapter 2  Processing Data

Devices Affecting Processing Speed

Page 43: Chapter 2  Processing Data

How Registers Affect Speed

The size of the registers, called word size, indicates the amount of data with which the computer can work at any given time

The bigger word size, the more quickly the computer can process a set of data

When we refer to 32-bit processor or 64-bit processor, we usually refer to the size of the register inside the processor chip

Page 44: Chapter 2  Processing Data

Memory and Computing Power

The amount of RAM in a computer can have a profound effect on the computer’s power

More RAM means the computer can use bigger, more powerful programs, and can access larger data files

Page 45: Chapter 2  Processing Data
Page 46: Chapter 2  Processing Data

The Computer Clock Speed

Every microcomputer has a system clock to time its processing operation

Clocks speeds has increased steadily First PC operated at 4.77 megahertz Nowadays PC operated at 2 gigahertz Hertz is a measure of cycles per second Megahertz (MHz) means millions of cycles per

second A CPU operating at 300 MHz can process

data more than twice as fast as the same one operating at 133 MHz

Page 47: Chapter 2  Processing Data

The Bus The bus refers to the electrical paths

between the components of a group of parallel wires

There are two types of bus The data bus The address bus

Page 48: Chapter 2  Processing Data

The Data Bus The bus for carrying data The number of wires in the bus affects

the speed at which data can travel between components

Each wire can transfer one bit at a time Bus Standards

Industry Standard Architecture (ISA) bus: 16-bit bus

Peripheral Component Interconnect (PCI) bus: 32-bit and 64-bit bus

Page 49: Chapter 2  Processing Data

The Address Bus The address bus is a set of wires that

connects the CPU and RAM and carries the memory address

The number of wires in address bus determines the maximum number of memory addresses

Today most CPUs have 32-bit address buses that can address up to 2^32 (4 Gigabytes of RAM)

Page 50: Chapter 2  Processing Data
Page 51: Chapter 2  Processing Data
Page 52: Chapter 2  Processing Data
Page 53: Chapter 2  Processing Data

Cache Memory Cache memory is similar to RAM, but

it is extremely fast compared to normal memory

The cache speeds up processing by storing frequently used data or instructions in its high-speed memory

We need cache because the speed of RAM is much slower than the speed of CPU

Page 54: Chapter 2  Processing Data
Page 55: Chapter 2  Processing Data

The Math Coprocessor A special chip designed to handle

complicated mathematical operations

The ALU in CPU is designed to manipulate whole numbers that are not too large or not too small.

If ALU is forced to work with decimals, it can really get boggled and slow down

Page 56: Chapter 2  Processing Data

The Math Coprocessor (Cont.)

The math coprocessor is a processing specialist designed to work with numbers that are very small or very large

It uses floating-point arithmetic techniques that translate numbers into the scientific notation 0.0000586 5.86 x 10-5

128610000000 1.2861 x 1011

Page 57: Chapter 2  Processing Data

Major Concepts Data vs. information Why a computer uses the binary number How a computer processes data

CPU Memory

Factors that affect processing speed CPUs used in modern personal

computers Connecting to external devices

Page 58: Chapter 2  Processing Data

The Intel ProcessorName Date Transistors Clock

speed

80386 1985 275,000 16 MHz

80486 1989 1,200,000 25 MHz

Pentium 1993 3,100,000 60 MHz

Pentium II 1997 7,500,000 233 MHz

Pentium III 1999 9,500,000 450 MHz

Pentium 4 2000 42,000,000 1.5 GHz

Page 59: Chapter 2  Processing Data

Advanced Micro Devices (AMD)

Chips of AMD 5x86 Pentium 75 MHz AMD K5 Pentium 133 to 166 MHz AMD K6 Pentium MMX 166 to 400 MHz AMD Althlon 64: 64-bit processor AMD Althlon XP: for Microsoft Windows XP AMD Althlon XP-M: Mobile AMD Althlon XP

AMD chips are usually cheaper than Intel’s but produce more heat.

Page 60: Chapter 2  Processing Data

CISC vs. RISC Intel 80x86 are complex instruction

set computing (CISC) processors The instruction sets for these CPUs are

large – 200 to 300 instructions RISC (Reduced Instruction Set

Computing) processor Each instruction is small and simple Has been the engine of mid-size

computers such as the IBM RS/6000, and high-end UNIX workstations built by SUN Microsystems

Page 61: Chapter 2  Processing Data

Parallel Processing A computer with more than one processor Produce faster data processing The dual-processor and quad-processor

versions of PCs are available today Windows NT/2000 operating systems can

make use of parallel processor computer The IBM 3090 has two to four processors The Cray X MP 4 has four processors

Page 62: Chapter 2  Processing Data

Parallel Processing (Cont.)

In parallel processing, multiple processors are used in a single system, enabling them to share processing tasks.

In a massively parallel processor (MPP) system, many processors are used.

Some MPP systems utilize thousands of processors simultaneously

Page 63: Chapter 2  Processing Data

Major Concepts Data vs. information Why a computer uses the binary number How a computer processes data

CPU Memory

Factors that affect processing speed CPUs used in modern personal

computers Connecting to external devices

Page 64: Chapter 2  Processing Data

Connecting to External Devices

Extending the processor’s power to other devices Ports Expansion slots and boards

Page 65: Chapter 2  Processing Data

Ports External devices—such as those used

for input and output—are connected to the system by ports on the back of the computer.

PCs feature a number of built-in ports, which are ready to accept devices such as a printer, mouse, keyboard, phone line, microphone and speakers, and others.

Most computers come with a serial port and a parallel port

Page 66: Chapter 2  Processing Data

A Serial Port Transmits one bit of data at a time

Page 67: Chapter 2  Processing Data

A Parallel Port Transmits data one byte at a time

Page 68: Chapter 2  Processing Data

SCSI Small Computer System Interface

Install the SCSCI Adapter in the slot Extending the bus to multiple

devices (up to 127 devices) through a single port

The newest SCSI standard, Ultra3 SCSI, supports a 32-bit bus and can transfer data at a rate 160 Mbps

Page 69: Chapter 2  Processing Data
Page 70: Chapter 2  Processing Data

Expansion Slots and Boards

If the PC does not have a port for an external device, you can install an expansion board into one of the empty expansion slots.

Newer bus technologies such as Universal Serial Bus (USB) and IEEE 1394 enable many devices to be connected to one port. Advantages of USB: No need of slot and

no need of opening the computer case

Page 71: Chapter 2  Processing Data