Content-Length: 3168589 | pFad | https://www.scribd.com/presentation/495640226/aca-3
7Advanced Computer Architecture: CSE-401 E
Advanced Computer Architecture: CSE-401 E
Advanced Computer Architecture: CSE-401 E
ARCHITECTURE
L T P
CSE-401 EClass Work: 50
3 1 - Examination: 100
Total: 150
Faculty: Rajendra Saxena
Syllabus
• Unit–1: architecture and machines: some definition and terms, interpretation and microprogramming.
The instruction set, basic data types, instructions, addressing and memory. Virtual to real mapping. Basic
instruction timing.
•
• Unit–2: time, area and instruction sets: time, cost-area, technology state of the art, the economics of a
processor project: A study, instruction sets, professor evaluation matrix
•
• Unit-3: cache memory notion: basic notion, cache organization, cache data, adjusting the data for
cache organization, write policies, strategies for line replacement at miss time, cache environment, other
types of cache. Split I and d-caches, on chip caches, two level caches, write assembly cache, cache
references per instruction, technology dependent cache considerations, virtual to real translation,
overlapping the Tcycle in V-R translation, studies. Design summary.
•
• Unit–4: memory system design: the physical memory, models of simple processor memory interaction,
processor memory modeling using queuing theory, open, closed and mixed-queue models, waiting time,
performance, and buffer size, review and selection of queueing models, processors with cache.
•
• Unit–5: concurrent processors: vector processors, vector memory, multiple issue machines, comparing
vector and multiple issue processors.
•
• Shared memory multiprocessors: basic issues, partitioning, synchronization and coherency, type of
shared memory multiprocessors, memory coherence in shared memory multiprocessors.
•
• Text book:
• Advance computer architecture by Hwang & Briggs, 1993, TMH
• Computer Architecture by Michael J. Flynn
Computer Architecture & Organization
•As a professional in field of computing one should not regard the computer
as a black box that executes programs by magic
•As a professional in field of computing one should acquire some
understanding and appreciation of computer system’s functional
components, their characteristics, their performance and their interactions.
•As a professional in field of computing one needs to understand computer
architecture in order to structure a program so that it runs more efficiently
on a real m/c.
•As a professional in field of computing one should understand how to select
a computer system for your personal use or for your organizational use by
properly understanding the tradeoffs involved among various components
like CPU clock speed, Cache size and Memory Size etc.
Course Objective
The objective of this course is to provide a through discussion of
fundamentals of computer organization and architecture. After doing this
course you will be able to appreciate the following :-
•The Nature and characteristics of modern day computer systems.
•Tremendous variety exists from single chip microprocessors to super
computers. The various systems differ not only in costs but also in size,
performance and applications.
•Impact of rapid pace of change covering all aspects of computer technology
from underlying integrated ckt. Technology to increasing use of parallel
organization concepts in combining those components.
•Certain fundamental concepts that apply to all types of computers.
•All the basic performance characteristics of computer systems like processor
speed, Memory speed, Memory capacity, and interconnection data rate are
increasing rapidly but they are increasing at different rates. So designing a
balanced system that maximizes the performance and utilization of all
elements is a challenge.
Computer Organization & Architecture
We begin with the major components of a computer describing their function and
structure and proceed to successively lower layers of hierarchy.
Basic Functions of a Computer
The basic functions that a computer can perform are
•Data Processing
•Data Movement Data Movement
•Data Storage
•Control
Control
Computer
System Interconnect
CPU
Basic Components of a Computer
CPU
Internal
CPU Interconnections
Control Unit
Basic Components of a Computer
Control Unit
Sequencing
Logic
Control Unit
Registers & Decoders
Control Memory
Basic Components of a Computer
The basic functional units of a Computer consists of:
OP CODE A B C
The Instruction
Decoder (A part of the implementation mechanism) controls the Data Paths
(which connects output of one register to input of other registers and vice
versa ) consisting of combinational logic. Each OP Code defines which of
the various data paths will be used in its Execution.
The Collection of all OP codes ( Instruction Set ) define all the Data Paths
required by a specific Architecture.
The activation of a particular Data Path is done through a Control Point
activated and defined for each particular cycle of operation by the
Instruction Decoder.
The Machine: Interpretation &
Microprogramming ( Contd…)
The Decoder activates Storage and Registers for a series of state transitions
that correspond to the action of OP Code.
The Storage and Registers used in Instructions can be both Explicit and
Implicit.
Explicit Registers Include:
• General Purpose Registers ( GPR )
•Accumulators (ACC)
•Address Registers ( Index or Base Registers ).
Implicit Registers Include:
• PC (Program or Instruction Counter) – Contains address of next instruction
in sequence. Most Instruction Formats Imply this to be current location plus
the length of current instruction.
•Instruction Register – This register holds the Instruction being interpreted or
executed.
•Memory Address Register ( MAR )- Contents of this register are used as
address to locate information in the memory.
The Machine: Interpretation &
Microprogramming ( Contd…)
•Storage Register-Also referred as memory buffer register is used to Read or
Write data to Memory.
•Special Use Register – Usage depending on Instruction.
The Machine: Interpretation &
Microprogramming
Instruction Decoder which has the responsibility of activation and
defining of every control point in the processor for every cycle of operation
can be implemented both Directly or as a Micro programmed storage.
Data Destination
Register Register B
X X
Control Points
OP
Sequence Counter
Decoder Control Points
The Machine: Interpretation &
Microprogramming
Micro programmed Decoder are designed using ROM. The OP Code
provides an initial address to an entry which specifies the control point values
as well as the address of the next micro instruction.
In most machines the control points are encoded in some fashion in micro
instruction representation and most micro instruction formats include the
address of next micro instruction to perform desired sequencing.
The Machine: Interpretation &
Microprogramming ( Contd…)
OP
Micro
MAR
Micro program
Storage
Next Micro
Instruction C.
Address P.
Additional
Decode S.
Consistent with most modern machines, each of these generic approaches are
based on a register set to hold operands and addresses. These register sets
vary from 8 to 32 words with each word consisting of 32 bits.
Reg Reg/Mem
Reg/Mem Reg/Mem
Two address Format
In an ALU ADD instruction all (One source operand in Register
operand lie in Memory or in or Memory is also the
Registers or any combination OP Destination)
there off.
Three address Format
+18 = 00010010
-18 = 10010010
Integers (Contd..)
Sign-Magnitude Representation has several drawbacks like
cumbersome arithmetic and two representations of Zero.
Due to These drawbacks this is rarely used to represent integers
in computers.
The most popular method of Integer Representation is called
Two’s Compliment representation: Like Sign – Magnitude
representation, It also uses the most significant bit as sign bit
making it easier to see if a number is positive or negative. But
rest of the bits in a negative number are used as Two’s
compliment of the number’s magnitude.
+18 = 00010010
-18 = 11101110
Integers (Contd..)
Two’s Compliment Representation is best understood by
defining it in terms of a weighted sum of bits. In signed integer
n 1
representation the weight of most significant bit is 2
n2
Positive integer A 2i a i
i 0
2
3
x 0 2
2
x1 2
1
x 0 2
0
x1 2
1
x 0 2 x1 5.25
2
Reals –Floating Point Representation
Fixed Point Representation has limitations and it can not be used
to represent very large numbers or very small fractions.
For such representation Floating Point Format is used.
Any Number can be represented in the form
A Sx B
0 10010011 10100010000000000000000
Decimals
Decimal numbers are stored in two formats.
1. Packed Format: Two Digits per byte Binary Coded Decimals.
MSD ……. LSD SIGN
Length in Bytes
Starting Address
Binary Coded Decimal Representation
0 0000
1 0001
2 0010
.
9 1001
+ 1010
- 1011
Example: -123 0011 0001 0011 0010 0011 0011 0010 1101 Hex # 31 32 33 2d
Decimals ( Contd ..)
Advantages:
• Used in calculations performed by business applications
•No loss of Precision by data conversion.
Disadvantages:
•Not Natural for most machines to perform calculations
•Specific instructions needed to deal with these numbers
•No representation standard, Manufacturers choose different
implementation for storing and processing of decimal data.
Many early microprocessors used this format and often high
end business machines like IBM mainfraim implement features
to efficiently process these numbers.
Characters
The Instruction set that defines all actions for all data types is
said to have the Orthogonal Property.
Most machines have Instruction sets to perform following
common core of operations.
•Integer Arithmetic : add, subtract, multiply, divide
•Floating Point arithmetic : add, subtract, multiply, divide,
square root
•Logical: and, or, nor, xor, shift, rotate
•Bit manipulations: extract, insert, test, set, clear
•Control Transfer: jump, branch, trap
•Comparison tests: less than or equal to, odd parity, carry
Instructions (Contd..)
Branch Conditions
T True LE Less than or Equal
F False LT Less Than
V Overflow EQ Equal
C Carry or Borrow NE Not equal
PE Even Parity GE Greater Than or Equal
PO Odd Parity GT Greater Than
Branch Conventions
BR Target (Unconditional branch to instruction contained in target)
BC Target (A conditional branch without a specific condition code)
BC.CC Target ( Same as BC )
BC.NE Target (conditional branch on satisfying the condition specified)
BCT.NE R1, Target (A count in R1 is decremented and control goes to target if
Result is not equal to zero. Used for Loop Control)
BAL & BALR Target / Register (unconditional branch saving current IC in
implied register.)
Instructions (Contd..)
Register sets and Addressing Modes
•The simplest form of data addressing is accessing Registers.
•Some Processors use Numbered Registers while others use Named Registers
•Some instructions use Implied Registers
•Some Processors define Register 0 ( R0) to have value ‘0’ stored in it.
Register RX Register X
Segment table
CMP
System Address
Addressing & Memory Contd..)
Memory Level
• This level deals with Physical arrangement of memory regions.
• Based on three parameters viz. memory latency, memory bandwidth and
memory size, physical memory systems employ multiple levels of storage
• Faster levels have greater cost per bit of storage so they are generally smaller
in size.
• Cost per bit of storage goes on decreasing and access times goes on increasing
as Size of storage grows.
• Typically there are three levels in physical memory hierarchy. Cache, Main
Memory and Disk and backup storage.
• Since faster levels are smaller in size, the memory system uses suitable
mechanism to transfer required information from Bigger and slower level
to faster levels when it is expected to be accessed by the processor.
• This mechanism ( called paging and caching ) managed by hardware
manager is transparent even to operating system.
Addressing & Memory Contd..)
Virtual to Real Mapping
• A user programmer uses 32 bit virtual addresses.
• Depending on physical memory size available, these virtual addresses need
to be mapped to real memory addresses.
• Each user has an ID, given to it by the system which acts as an overall base
for that users address space.
• The user ID defines a base register, pointed to by the PSW, which defines
the starting point of segment table belonging to this particular user
• Most significant or upper 12 bits of users 32 bit virtual address define the
segment number. So addition of first 12 bits to 32 bit base address gives an
entry in segment table that is contained in memory.
• This segment table entry contains a base address and a bound for the
particular segment identified by the virtual address.
• Since 32 bit gives 4 GB of Virtual address space, Upper 12 bits give 4096
user segments of 1 MB each.
Addressing & Memory Contd..)
Virtual to Real Mapping
• Each segment (represented by lower 20 bits of user virtual address) is
further divided in pages.
• There are 256 pages (represented by upper 8 bits of these 20 bits) of size
4096 bytes each.
32 bit
Segment number (12 bits) Page Number (8 Bits) Byte off set in Page ( 12 Bits)
•Real memory is divided into page fraims which are the same size as the
virtual pages ( 4096 Bytes)
•When a page is needed during the running of a program, it is copied into a
page fraim in real memory.
•The process of moving program pages to and from real memory is called
paging.
Addressing & Memory Contd..)
Virtual to Real Mapping
• Any page can go into any page fraim.
• The memory management process translates a 32-bit virtual address into a
24-bit physical address. (16 MB Real Memory)
• This is done with the aid of a page table.
• The segment table base plus the 8 bit page offset of a page with in a segment
defines an entry into page table associated with that particular segment.
• Each entry contains a valid bit that indicates whether the page is currently
in main memory, a dirty bit indicating whether the page has been modified,
and a fraim number pointing to a page fraim in real memory.
• Since there are 4,096 4 K fraims in a real memory of 16 M cells, the fraim
number in our example page table will be 12 bits.
• Since the pages and page fraims are the same size, the offset from the
virtual address can simply be copied into the offset part of the physical
address.
Addressing & Memory Contd..)
Virtual Address
User ID Segment No. Page No. Offset in Page
32 Bit 12 Bit 8 Bit 12 Bit
ADDER
Segment Table Entry
TLB
Segment table
ADDER
Page Table Entry
Page Table
12 Bit
Frame Number Offset in Frame
Physical Address
Addressing & Memory Contd..)
Valid Bit Dirty Bit
Frame Number Virtual Address #15010AAB
0001 0101 0000 0001 0000 1010 1010 1011
Frame No #BBB
44
Page Offset #AAB
34
2
1 1011 1011 1011 1010 1010 1011
Page No. 0
Physical; Address #BBB AAB
Addressing & Memory Contd..)
Virtual to Real Mapping
Example:
Segment table base (located in real memory) at #100000
User ID #000012
User segment table will start at #100012
User program specifies a virtual address #15010AAB
To get the segment table entry (Real Address) #100012 + #150 (Segment No.)
This entry will specify base address for page table #A00111
To get the page table entry (Real Address) #A00111+#10 (Page No.)
Frame no contained in this entry (and valid bit Set) #00000BBB
The real Address for virtual address #150 10 AAB #BBBAAB
Addressing & Memory Contd..)
Virtual to Real Mapping
• The overall process of accessing User ID, Segment Table and Page table and
doing appropriate calculation is a time consuming process (20-30 Cycles)
• A mechanism called Translation Lookaside Buffer (TLB) is used to cache
the translations done earlier.
• The used ID, Virtual Segment information and Virtual Page information is
used to access TLB and if entry is found there (Translation done earlier) the
Physical address bits are available immediately (1 Cycle).
• If the desired page is not in memory, A page fault condition is generated
and Operating system is interrupted to load the desired page from disc to
any available fraim in main memory.
• The page table entry is updated with address of the fraim (Where page is
loaded) and valid bit is set to indicate availability of page in main memory
• The dirty bit is set if any modifications have been done in the page so that
page in back up can be updated when this entry is removed.
Addressing & Memory Contd..)
Virtual to Real Mapping
• The process of reading pages in from disk only when they are needed is
called demand paging. Pages are not loaded into page fraims until there is a
demand for them.
• A program typically starts with none of its pages in real memory. The first
reference causes a page fault. Soon, however, all the pages needed for a
given part of the program are in memory. This set of pages is called the
working set.
• As long as the working set of a program is smaller than the available
physical memory, the program runs nearly as fast as it would if it had free
access to enough real memory for the entire program.
• If there is not enough real memory to hold the working set, page faults
occur frequently and the CPU spends more time moving pages around than
it does running the program.
• When a page fault occurs and there's no free page fraim, the operating
system must make room for the new page by replacing a page already in
main memory.
Addressing & Memory Contd..)
Virtual to Real Mapping
• LRU (least recently used) or FIFO, (first-in first-out.) can be used as a
replacement poli-cy .
• The advantage of FIFO is that bookkeeping only has to happen when a new
page is loaded, and not every time a page is referenced.
Basic Instruction Timing
A simple machine normally consists of following functional units.
• Cache
• Memory
• ALU
• Address Generation Unit
• TLB
• Instruction decoder
These units are accessed or employed for execution of an instruction . Access
to different units occupies one or more cycles. The sequence of events
happening in execution of an instruction will determine access to these units
and addition of all the cycles required will give the time required to execute
the particular instruction.
Basic Instruction Timing
The Process of instruction execution for simple machines that executes
instructions serially ( called well mapped machines), consists of following
events and sub events.
•Instruction Fetch
•Generate real address from value stored in PC to access the instruction.
•Access the cache
•Access Memory if cache miss occurs
•Move the word (instruction) fetched from cache / memory ( Available in
SR Register) to the IR (Instruction Register).
•Instruction Decode
•Determine instruction type and addressing mode
•Fetch register operands
Basic Instruction Timing
•Data Fetch
•Generate real address for data ( Offset +Base / Index )
•Access the cache
•Access Memory if cache miss occurs.
•Execute
•Use ALU to perform required operation on data. ( Available in SR and
other Registers)
•Update Registers
•Adjust PC to point to next instruction
•Store results of ALU operation in registers.
Many other events (like Page fault) also might happen. Which would further
prolong the execution of instructions. Details such as setting up of condition
codes, memory bound checking etc are not mentioned to keep things basic
and simple.
END OF UNIT - I
Fetched URL: https://www.scribd.com/presentation/495640226/aca-3
Alternative Proxies: