chapter 2 processing data
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 PresentationTRANSCRIPT
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 Connecting to external devices
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
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
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
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
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
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
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
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
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
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
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
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
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
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 []\
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
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
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
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
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
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
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)
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
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.
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
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
Arithmetic Operations
Symbol Operations+ Add
- Subtract
x Multiply
/ Divide
^ Raise by a power
Logical Operations
Symbol Operations= Equal
<>, != Not equal
> Greater than
>= Greater than or equal
< Less than
<= Less than or equal
~, ! Not
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
Memory (Cont.)
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
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
RAM Chips
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
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
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
Memory AccessTo request a byte of data, the CPU sends a memory address to RAM
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
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
Devices Affecting Processing Speed
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
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
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
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
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
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)
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
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
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
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
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
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.
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
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
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
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
Connecting to External Devices
Extending the processor’s power to other devices Ports Expansion slots and boards
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
A Serial Port Transmits one bit of data at a time
A Parallel Port Transmits data one byte at a time
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
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