Вы находитесь на странице: 1из 35

Central Processing Unit

Learning Objectives
When you complete this chapter, you will:
state the functions and basic units of a
central processing unit,
explain how instructions are picked up and
executed by the CPU,
be aware that all the information inside the
computer is stored and processed in binary
codes.
Chapter 12. Central Processing Unit
12.1 Central Processing Unit
12.2 Functions of Different Units
12.3 Data Representation in
Computer
12.1 Central Processing Unit
12.1 Central Processing Unit

Central Processing Unit

Central Processing Unit is the core


component of a computer. It executes
user’s instructions and processes
calculations.
Like the chief commander of an army, the
CPU controls and co-ordinates various
devices in the computer system.

Without the CPU, the devices cannot work


together and so the computer cannot
function.
12.1 Central Processing Unit

Central Processing Unit

CPU is often etched on a chip and is


usually called a microprocessor.

Intel Cyrix III


Pentium III

AMD
Intel Athlon XP
Pentium 4
12.2 Functions of Different
Units
12.2 Functions of Different Units

Functions of Different Units

A CPU consists of two basic units:

Control
unit Arithmetic
and logic unit

Some
registers
12.2 Functions of Different Units

Control Unit

The control unit executes the


instructions, sends control signals to
and receive control signals from
peripheral devices.
In other words, it controls the whole
computer, and directs the entire system to
carry out instructions.
12.2 Functions of Different Units

Arithmetic and Logic Unit

Arithmetic unit

Arithmetic and handles arithmetic


Logic Unit calculations

Logic unit

performs logical
calculations and makes
judgement like “if A > B is
true”.
12.2 Functions of Different Units

Registers

When the control unit and the


arithmetic and logic unit operate, they
store the information and instruction
temporarily in registers.
12.2 Functions of Different Units

Program Executions
Before a computer executes
instructions, they are first placed in the
The memory.
main diagram shows how the CPU executes an
instruction:
Control unit Arithmetic and
logic unit
Decode Execute

This is called
Main memory
machine cycle.

Fetch
12.2 Functions of Different Units

Program Executions
Fetching

The control unit gets the next


program instruction from the main
memory.
Decoding

The control unit decodes what the instruction


means.
12.2 Functions of Different Units

Program Executions
Executing

The ALU executes arithmetic and


logical instructions. It means that the
ALU controls and performs the actual
operation on the data.
12.3 Data Representation in
Computer
12.3 Data Representation in Computer
Data Representation in
Computer
Computers use the binary system to
store and process information.
• In the binary system, there are only numbers 0
and 1, which are called binary digits.

Music is stored as a sequence of 1s and 0s in the computer


12.3 Data Representation in Computer
Data Representation in
Computer
All sorts of information, such as text,
sound and graphics, can be stored as
a sequence of binary digits (bit
pattern).
12.3 Data Representation in Computer
Data Representation in
Computer
Inside the computer, these binary
digits are represented by two-state
0 represents an
devices.
electronic state of “OFF” 1 represents an
or a signal with “no electronic state of “ON”
pulse” or a signal with a “pulse”

The binary digits (bit pattern) are represented


by two electronic states in the comoputer
12.3 Data Representation in Computer
Data Representation in
Computer
Inside the computer, these binary digits
can also be represented by the following
two-state device.

0 represents “OFF” 1 represents “ON”


12.3 Data Representation in Computer

Bit and Byte of Binary System

In the binary system, different


combinations of 0s and 1s represent
different units such as bit and byte for
data.
12.3 Data Representation in Computer

Bit and Byte of Binary System


Bit
Each 0 and 1 in the binary system is
called a bit. The bit is the basic unit for
representing data in the computer
memory.
Byte
Bits are put together in a group of eight to form
a byte.

1 byte = 8 bits
12.3 Data Representation in Computer

Bit and Byte of Binary System

In most computer systems, 1 byte


memory is used to store an English
character. Do you know
the bit pattern
representing
H?

The answer
is 01001000
12.3 Data Representation in Computer

Coding Information with Two-state Device


There are many examples of two-state
devices in our everyday life. They can be
used to demonstrate the binary digits.
Binary digits
Two-state
0 1
device

Light bulb
Off On
12.3 Data Representation in Computer

Coding Information with Two-state Device


There are many examples of two-state
devices in our everyday life. They can be
used to demonstrate the binary digits.
Binary digits
Two-state
0 1
device
Switch

Coin
12.3 Data Representation in Computer
It’s On!
If represents 1 and represents 0, then
two light bulbs can be used to represent four bits
patterns.
Bit
Light bulbs
pattern
0 0

0 1

1 0

1 1
12.3 Data Representation in Computer
It’s On!
If represents 1 and represents 0, then
two light bulbs can be used to represent four bits
patterns.
How many bit patterns can be shown by three light bulbs?
List all these bit patterns.
000, 001 , 010 , 011 , 100 , 101 , 110 , 111
, 23 = 8
12.3 Data Representation in Computer
Binary
You can obtain the result of Class Activity 1
by trying the CAL program “Binary” from
the Learning disc.

Click these
switches
alternately.
The pattern
found will
be listed on
the right.
12.3 Data Representation in Computer
Secret Message
In this activity, A to Z will be coded by 8
binary bits according to the following table.
12.3 Data Representation in Computer
Secret Message
Run the CAL program “Secret Message” from
the Learning disc. Try to decode the messages
from the computer

Decode The answer


this is displayed
message here

Input your
message here
12.3 Data Representation in Computer
How Well Do You Know CPU?
Test your knowledge of CPU by answering the
following:

1. The CPU consists of two basic units:


___________________
control unit and ______________________.
arithmetic and logic unit

control unit
2. The entire computer system is controlled by ___________.

3. The three steps of the machine cycle are: __________,


fetching
__________
decoding and __________.
executing
12.3 Data Representation in Computer
How Well Do You Know CPU?
Test your knowledge of CPU by answering the
following:

4. What is each ________


0 and ________
1 in the binary
system called? ________
bit

5. 1 byte = ________
8 bits

6. How many bit patterns can be represented by 4 bits?


________
16
Key Words
Key Words
• control unit 控制部件
• arithmetic and logic unit 算術及邏輯運算部件
(ALU)
• register 寄存器
• machine cycle 機器周期
• fetching 取碼
• decoding 譯碼
• executing 執行
• binary digit 二進制數字
• bit pattern 位元樣式
Key Words
• bit 位元
• byte 字節
*** The End ***

Вам также может понравиться