Title: THE CENTRAL PROCESSING UNIT CPU
1CHAPTER 2
- THE CENTRAL PROCESSING UNIT (CPU)
2Objectives
- Learn the key components of digital computers
- Understand their main functions
- Learn the different integer representations and
their significance
3Chapter Outline
- Introduction
- The Control Unit
- Register Organisation
- The ALU
- Integer Representation
4CPU
Control Unit
Register
Internal CPU Interconnection
ALU
52.1 Introduction
- CPU- part of a computer that interprets and
carries out the instructions contained in
software. - The CPU or processor manages most of a computers
operations. - On a PC, the CPU is contained in a single chip
and is called the microprocessor.
2-1
6Microprocessor electronic computer CPU made from
transistor and other circuit elements on a single
semiconductor integrated circuit (IC)
- Different types of microprocessors
- CISC (Complex Instruction Set Computers) eg.
Intel, IBM - RISC (Reduced Instruction Set Computers) eg.
SPARC, MIPS
2-2
7- CPU designs is often referred to as a CPU
architecture. - Intels 8051 architecture
- Intels x86 architecture
- Sun microsystems SPARC architecture
- Emerging CPU architecture
- Intels IA-64 architecture (HP/Intel Itanium)
- AMD x86-64 architecture (AMD AMD64and Intel
EM64T) - IBM Cells architecture (Sony/IBM Cell processor)
2-3
8Example Intel 80486DX2 Intel 80386
2-4
92-5
10- The CPU consists of 3 main components
- Control Unit (CU)
- Arithmetic and Logic Unit (ALU)
- Registers
2-6
112.2 The Control Unit
- part of a CPU responsible for performing the
machine cycle-fetch, decode, execute, store. - directs the CPUs operations fetches
instructions from memory, decodes them and
produces signals which control the other parts of
the computer - CU supervises all computer operations including
- Controls data transfer between components
- Involved in the instruction cycle
- Work controller
- Generates control signal
- Functions as a controller to ALU
- Generates timing signal
2-7
12Model of the Control Unit
2-8
13- Model of control unit showing all inputs and
outputs. - Input
- Clock
- Instruction register
- Flags
- Control signals from control bus
- output
- Control signal within processor
- Control signal to control bus
2-9
14- Clock
- CU relies on a chip called system clock which
controls the timing of all computer operations - It generates regular electronic pulses or ticks
and issues a command at each 'tick' of the clock - The number of ticks per second (MHz) measures the
speed of a processor - 2002 a fast microcomputer has a clock speed of
1.8 GHz (means that the CU can issue about 1.8
billion instructions in a second ... every
second.
2-10
15Control Signals example
Data Paths and Control Signals
2-11
162.3 Register Organization
- Registers form the highest level of the memory
hierarchy - Small set of high speed storage locations
- Temporary storage for data and control
information - 2 types of registers
- User-visible
- May be referenced by assembly-level instructions,
thus, visible to the user - Control and status registers
- Used to control the operation of the CPU
- Most are not visible to the user
2-12
172-13
18- User-visible registers
- General categories based on functions
- General purpose
- Can be assigned a variety of functions
- Data
- Only hold data
- Address
- Only hold address information e.g. segment
pointers, index registers - Condition codes
- Visible to the users but values are set by the
CPU as the result of performing operations - Examples positive, zero, overflow
2-14
19- Control and Status Registers
- These registers are used during the fetching,
decoding and execution of instructions. - Many are not visible to the users
- Some are visible but cannot be easily modified
- Typical registers
- Program Counter (PC)
- Instruction Register (IR)
- Memory Address Register (MAR)
- Memory Data Register (MDR)
- Program Status Word (PSW)
2-15
202.4 The ALU
- The part of the computer that actually performs
arithmetic and logical operations on data - All other elements of the computers are mainly
there to bring data to the ALU for processing or
to take results from the ALU - Registers are used as sources and destinations
for most ALU operations - In early machines, simplicity and reliability
determined the overall structure of the CPU and
its ALU
2-16
21- The power and flexibility of the CPU is improved
through increases in the complexity of the
hardware- - Use general register sets to store operands,
addresses and results - Increase the capabilities of the ALU
- Use special hardware to support transfer of
execution between points in a program
2-17
222.5 Integer Representation
- Sign-magnitude format
- Positional representation using n bits
- Left most bit position is the sign bit
- 0 for positive number
- 1 for negative number
- Remaining n-1 bits represent the magnitude
Sign must be considered during arithmetic
operations Dual representation of zero (-0 and 0)
2-18
23Have a dual representation for 0
- Ones complement format
- Binary case of diminished radix complement
- Negative numbers are represented by a bit-by-bit
complementation of the positive magnitude - Sign bit interpreted as in sign-magnitude format
- Examples (8 bit words)
- 42 0 00101010
- -42 1 11010101
2-19
24- Twos complement format
- Binary case of radix complement
- Negative numbers, -X, are represented by
pseudo-positive number - Given the representation for X, the
representation for X is found by taking the 1s
complement of X and adding 1 - Examples
- 42 00101010
- 11010101
- 1
- -42 11010110
2-20
25Prove it..!
2-21
26Chapter Exercises
What are the design trade offs between general
purpose and specialized registers? How many
registers are enough? How big/wide should a
register be?