5_CH03 - Computer Function CPU (1)
5_CH03 - Computer Function CPU (1)
Chapter 3
A Top-Level View
of Computer
Function and
Interconnection
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Computer Components
• Contemporary computer designs are based on concepts
developed by John von Neumann at the Institute for
Advanced Studies, Princeton
• Referred to as the von Neumann architecture and is
based on three key concepts:
– Data and instructions are stored in a single read-write memory
– The contents of this memory are addressable by location, without
regard to the type of data contained there
– Execution occurs in a sequential fashion (unless explicitly
modified) from one instruction to the next
• Hardwired program
– The result of the process of connecting the various components in the
desired configuration
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 3.1
Hardware and
Software
Approaches
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Software and I/O Components
Software
• A sequence of codes or instructions
• Part of the hardware interprets each instruction and generates
control signals
• Provide a new sequence of codes for each new program instead of
rewiring the hardware
Major components:
• CPU
• Instruction interpreter
• Module of general-purpose arithmetic and logic functions
• I/O Components
• Input module
• Contains basic components for accepting data and instructions
and converting them into an internal form of signals usable by the
system
• Output module
• Means of reporting results
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Computer Function
• The basic function performed by a computer is execution of a program.
The processor does the actual work by executing instructions specified in
the program. Two main components are:
• Central Processing Unit (CPU) / Processor
• Memory it is about 4096 word
– 4096 = 212 : require 12 bits to select a word in memory
▪ Each word: 16 bits long
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Overview of Key elements
• Program
– A sequence of (machine) instructions (fetch & execution)
• (Machine) Instruction Processing
– A group of bits that tell the computer to perform a specific
operation (a sequence of microoperation)
• Steps:
– The CPU reads (fetches) instructions from memory one at a
time and executes each instruction.
– The CPU reads the next instruction from memory and
places it in an Instruction Register (IR)
– The control unit translates the binary code of the instruction
and proceeds to execute it by issuing a sequence of
microoperations
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Memory, MAR, and MBR
Memory Memory buffer
address register register (MBR)
(MAR) • Contains the data to
• Specifies the be written into
address in memory memory or
for the next read or receives the data
write read from memory
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
CPU Main Memory
0
Figure 3.2: System
Bus
1
2
PC MAR
Computer Instruction
Instruction
Instruction
Components: IR MBR
Top-Level Execution
I/O AR
Data
Data
View unit I/O BR
Data
Data
PC = Program counter
Buffers IR = Instruction register
MAR = Memory address register
MBR = Memory buffer register
I/O AR = Input/output address register
I/O BR = Input/output buffer register
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 3.2 Computer Components: Top-Level View
BC Registers
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Common Bus System - 1
Fig. 5-4
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 3.3
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Fetch Cycle
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Action Categories
• Data • Data transferred to
transferred or from a
from processor peripheral device
by transferring
to memory or between the
from memory to processor and an
processor I/O module
Processor- Processor-
memory I/O
Data
Control
processing
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 3.4: Characteristics of a Hypothetical Machine
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Instruction Format
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Address Modes
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 3.5: Example of Program Execution
(contents of memory and registers in hexadecimal)
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 3.6
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Table 3.1: Classes of Interrupts
Program Generated by some condition that occurs as a result
of an instruction execution, such as arithmetic
overflow, division by zero, attempt to execute an
illegal machine instruction, or reference outside a
user’s allowed memory space.
Timer Generated by a timer within the processor. This
allows the operating system to perform certain
functions on a regular basis.
I/O Generated by an I/O controller, to signal normal
completion of an operation, request service from the
processor, or to signal a variety of error conditions.
Hardware Failure Generated by a failure such as power failure or
memory parity error.
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 3.9
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 3.12: Instruction Cycle State Diagram,
with Interrupts
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
I/O Function
• I/O module can exchange data directly with the processor
• Processor can read data from or write data to an I/O module
– Processor identifies a specific device that is controlled by a particular I/O
module
– I/O instructions rather than memory referencing instructions
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 3.15: Computer Modules
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Memory Stack Organization
• Memory stack: a portion of memory is used as a stack, With a
processor register as a stack pointer
• Memory partitioned into three types of segments:
– Program, Data, Stack segments
Push-Pop
Overflow/underflowa
Most computers do not provide HW to check stack overflow (full stack)
or stack underflow (empty stack) --> must be done in SW
(Two registers are used to hold the upper(3000)/lower (4001) limits:
After push/pop operation, SP is compared with the upper/lower limit)
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
The interconnection structure must support the
following types of transfers:
An I/O
module is
allowed to
exchange
Processor data
Processor directly
reads an Processor
reads data Processor with
instructio writes a
from an sends data memory
n or a unit unit of
I/O device to the I/O without
of data data to going
via an I/O device
from memory through the
module
memory processor
using
direct
memory
access
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
A communication pathway Signals transmitted by any
connecting two or more one device are available for
devices reception by all other
• Key characteristic is that it is a devices attached to the bus
shared transmission medium • If two devices transmit during the
same time period their signals
will overlap and become garbled
Bus
Interconnection
Typically consists of
multiple communication Computer systems contain a
lines number of different buses
that provide pathways
• Each line is capable of between components at
transmitting signals representing
binary 1 and binary 0 various levels of the
computer system hierarchy
System bus
• A bus that connects major The most common computer
computer components (processor,
memory, I/O) interconnection structures
are based on the use of one
or more system buses
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Data Bus
• Data lines that provide a path for moving data among system
modules
• May consist of 32, 64, 128, or more separate lines
• The number of lines is referred to the width of the data bus
• The number of lines determines how many bits can be
transferred at a time
• The width of the data bus is a key factor in determining overall
system performance
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Address Bus Control Bus
• Used to designate the source or • Used to control the access and the
destination of the data on the use of the data and address lines
data bus
– If the processor wishes to • Because the data and address lines
read a word of data from are shared by all components there
memory it puts the address must be a means of controlling their
of the desired word on the use
address lines
• Control signals transmit both
• Width determines the maximum command and timing information
possible memory capacity of the
among system modules
system
• Also used to address I/O ports • Timing signals indicate the validity
– The higher order bits are of data and address information
used to select a particular • Command signals specify
module on the bus and the operations to be performed
lower order bits select a
memory location or I/O port
within the module
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Components of CPU
•Storage Components
–Registers
–Flags
•Processing Components
–Arithmetic Logic Unit (ALU): Arithmetic/Logical
computations, Shifts/Rotates
•Transfer Components
– Bus
•Control Components
–Control Unit
31
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Registers
•In BC,
– Only one general purpose register, the Accumulator (AC)
32
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
General Register Organization
33
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Operation of Control Unit
Table 8.3
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 3.16
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Point-to-Point Interconnect
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Intel’s Quick Path Interconnect (QPI)
• Introduced in 2008
• Multiple direct connections
– Direct pairwise connections to other components eliminating the need for
arbitration found in shared transmission systems
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 3.18
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 3.22
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
A Top-Level View of
Summary Computer Function and
Interconnection
Chapter 3
• Point-to-point interconnect
• Computer components
– QPI physical layer
• Computer function
– QPI link layer
– Instruction fetch and execute
– QPI routing layer
– Interrupts
– QPI protocol layer
– I/O function
• PCI express
• Interconnection structures
– PCI physical and logical
• Bus interconnection
architecture
– PCIe physical layer
– PCIe transaction layer
– PCIe data link layer
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Copyright
This work is protected by United States copyright laws and is provided solely
for the use of instructions in teaching their courses and assessing student
learning. dissemination or sale of any part of this work (including on the
World Wide Web) will destroy the integrity of the work and is not permit-
ted. The work and materials from it should never be made available to
students except by instructors using the accompanying text in their
classes. All recipients of this work are expected to abide by these
restrictions and to honor the intended pedagogical purposes and the needs of
other instructors who rely on these materials.
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved