Docsity

ACA Notes for new students, Lecture notes of Geology

Toggle sidebar
bg1
Chameli Devi Group of Ins�tu�ons
Department of Computer Science and Engineering
Subject Notes
Subject Code: CS-6001 Subject Name: Advanced Computer Architecture
UNIT-1
Flynn's Classifica�on
Flynn’s classifica�on dis�nguishes mul�-processor computer architectures according to two independent
dimensions of Instruc�on stream and Data stream. An instruc�on stream is sequence of instruc�ons executed
by machine. And a data stream is a sequence of data including input, par�al or temporary results used by
instruc�on stream. Each of these dimensions can have only one of two possible states: Single or Mul�ple.
Flynn’s classifica�on depends on the dis�nc�on between the performance of control unit and the data
processing unit rather than its opera�onal and structural interconnec�ons. Following are the four category of
Flynn classifica�on and characteris�c feature of each of them.
a) Single Instruc�on Stream, Single Data Stream (SISD)
The figure 1.1 is represents an organiza�on of simple SISD computer having one control unit, one processor
unit and single memory unit.
Instruc�on Data
Stream Stream
Figure 1.1: SISD processor organiza�ons
•They are also called scalar processor i.e., one instruc�on at a �me and each instruc�on have only
one set of operands.
•Single instruc�on: only one instruc�on stream is being acted on by the CPU during any one clock
cycle.
•Single data: only one data stream is being used as input during any one clock cycle.
b) Single Instruc�on Stream, Mul�ple Data Stream (SIMD) processors
•A type of parallel computer.
•Single instruc�on: All processing units execute the same instruc�on issued by the control unit at any
given clock cycle as shown in figure where there is mul�ple processors execu�ng instruc�on given
by one control unit.
•Mul�ple data: Each processing unit can operate on a different data element as shown if figure
below the processor are connected to shared memory or interconnec�on network providing
mul�ple data to processing unit.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a

Partial preview of the text

Download ACA Notes for new students and more Lecture notes Geology in PDF only on Docsity!

Chameli Devi Group of Ins�tu�ons

Department of Computer Science and Engineering

Subject Notes

Subject Code: CS-6001 Subject Name: Advanced Computer Architecture

UNIT-

Flynn's Classifica�on

Flynn’s classifica�on dis�nguishes mul�-processor computer architectures according to two independent dimensions of Instruc�on stream and Data stream. An instruc�on stream is sequence of instruc�ons executed by machine. And a data stream is a sequence of data including input, par�al or temporary results used by instruc�on stream. Each of these dimensions can have only one of two possible states: Single or Mul�ple. Flynn’s classifica�on depends on the dis�nc�on between the performance of control unit and the data processing unit rather than its opera�onal and structural interconnec�ons. Following are the four category of Flynn classifica�on and characteris�c feature of each of them.

a) Single Instruc�on Stream, Single Data Stream (SISD)

The figure 1.1 is represents an organiza�on of simple SISD computer having one control unit, one processor unit and single memory unit.

Instruc�on Data

Stream Stream

Figure 1.1: SISD processor organiza�ons

  • They are also called scalar processor i.e., one instruc�on at a �me and each instruc�on have only one set of operands.
  • Single instruc�on: only one instruc�on stream is being acted on by the CPU during any one clock cycle.
  • Single data: only one data stream is being used as input during any one clock cycle.

b) Single Instruc�on Stream, Mul�ple Data Stream (SIMD) processors

  • A type of parallel computer.
  • Single instruc�on: All processing units execute the same instruc�on issued by the control unit at any given clock cycle as shown in figure where there is mul�ple processors execu�ng instruc�on given by one control unit.
  • Mul�ple data: Each processing unit can operate on a different data element as shown if figure below the processor are connected to shared memory or interconnec�on network providing mul�ple data to processing unit.

Figure 1.2: SIMD processor organiza�ons

C) Mul�ple Instruc�on Stream, Single Data Stream (MISD)

  • A single data stream is feed into mul�ple processing units.
  • Each processing unit operates on the data independently via independent instruc�on streams as shown in figure 1.3 a single data stream is forwarded to different processing unit which are connected to different control unit and execute instruc�on given to it by control unit to which it is a�ached.

Figure 1.3: MISD processor organiza�ons

  • Thus in these computers same data flow through a linear array of processors execu�ng different instruc�on streams.

d) Mul�ple Instruc�on Stream, Mul�ple Data Stream (MIMD)

  • Mul�ple Instruc�ons: Every Processor may be execu�ng a different instruc�on stream.
    • Mul�ple Data: every processor may be working with a different data stream as shown in figure 1. mul�ple data stream is provided by shared memory.
    • Can be categorized as loosely coupled or �ghtly coupled depending on sharing of data and control.
    • Execu�on can be synchronous or asynchronous, determinis�c or non- determinis�c.
  • Examples: most current supercomputers, networked parallel computer "grids" and mul�-processor SMP computers - including some types of PCs.

The processor cycles required for each instruc�on (CPI) can be a�ributed to cycles needed for instruc�on decode and execu�on (p), and cycles needed for memory references (m* k).

The total �me needed to execute a program can then be rewri�en as

T = Ic* (p + mk)τ

Parallel Computer Models

Mul�processor and Mul�computer

Two categories of parallel computers are discussed below namely shared common memory or unshared distributed memory.

Shared Memory Mul�processor

  • Shared memory parallel computers vary widely, but generally have in common the ability for all processors to access all memory as global address space.
  • Mul�ple processors can operate independently but share the same memory resources.
  • Changes in a memory loca�on effected by one processor are visible to all other processors.
  • Shared memory machines can be divided into two main classes based upon memory access �mes: UMA, NUMA and COMA.

Uniform Memory Access (UMA):

  • Most commonly represented today by Symmetric Mul�processor (SMP) machines.
  • Iden�cal processors.
  • Equal access and access �mes to memory.
  • Some�mes called CC-UMA - Cache Coherent UMA. Cache coherent means if one processor updates a loca�on in shared memory, all the other processors know about the update. Cache coherency is accomplished at the hardware level.

Figure 1.5: Shared Memory (UMA)

Non-Uniform Memory Access (NUMA):

  • O�en made by physically linking two or more SMPs
  • One SMP can directly access memory of another SMP
  • Not all processors have equal access �me to all memories
  • Memory access across link is slower

If cache coherency is maintained, then may also be called CC-NUMA - Cache Coherent NUMA

Figure 1.6: Shared Memory (NUMA)

The COMA model (Cache only Memory Access): The COMA model is a special case of NUMA machine in which the distributed main memories are converted to caches. All caches form a global address space and there is no memory hierarchy at each processor node.

Advantages:

  • Global address space provides a user-friendly programming perspec�ve to memory
  • Data sharing between tasks is both fast and uniform due to the proximity of memory to CPUs

Disadvantages:

  • Primary disadvantage is the lack of scalability between memory and CPUs. Adding more CPUs can geometrically increases traffic on the shared memory-CPU path, and for cache coherent systems, geometrically increase traffic associated with cache/memory management.
  • Programmer responsibility for synchroniza�on constructs that insure "correct" access of global memory.
  • Expense: it becomes increasingly difficult and expensive to design and produce shared memory machines with ever increasing numbers of processors.

Distributed Memory

Like shared memory systems, distributed memory systems vary widely but share a common characteris�c. Distributed memory systems require a communica�on network to connect inter-processor memory.

Figure 1.9: Configura�ons of SIMD Computers

These processors consist of a number of memory modules which can be either global or dedicated to each processor. Thus the main memory is the aggregate of the memory modules. These Processing elements and memory unit communicate with each other through an interconnec�on network. SIMD processors are especially designed for performing vector computa�ons. SIMD has two basic architectural organiza�ons

a. Array processor using random access memory

b. Associa�ve processors using content addressable memory.

Data and Resource Dependence

Data dependence : The ordering rela�onship between statements is indicated by the data dependence. Five type of data dependence are defined below:

  1. Flow dependence: A statement S2 is flow dependent on S1 if an execu�on path exists from s1 to S2 and if at least one output (variables assigned) of S1feeds in as input (operands to be used) to S2 also called RAW hazard and denoted as S1 -> S
  2. An�-dependence: Statement S2 is an�-dependent on the statement S1 if S2 follows S1 in the program order and if the output of S2 overlaps the input to S1 also called RAW hazard and denoted as S1 |->S
  3. Output dependence: two statements are output dependent if they produce (write) the same output variable. Also called WAW hazard and denoted as S1 0->S
  4. I/O dependence: Read and write are I/O statements. I/O dependence occurs not because the same variable is involved but because the same file referenced by both I/O statement.
  5. Unknown dependence: The dependence rela�on between two statements cannot be determined in the

Consider the following fragment of any program: S1 Load R1, A

S2 Add R2, R

S3 Move R1, R

S4 Store B, R

  • Here the Forward dependency S1to S2, S3 to S4, S2 to S
  • An�-dependency from S2to S
  • Output dependency S1 toS

Control Dependence : This refers to the situa�on where the order of the execu�on of statements cannot be determined before run �me. For example all condi�on statement, where the flow of statement depends on the output. Different paths taken a�er a condi�onal branch may depend on the data hence we need to eliminate this data dependence among the instruc�ons. This dependence also exists between opera�ons performed in successive itera�ons of looping procedure. Control dependence o�en prohibits parallelism from being exploited.

Control-independent example:

for (i=0;i<n;i++) {

a[i] = c[i];

if (a[i] < 0) a[i] = 1;

}

Control-dependent example:

for (i=1;i<n;i++) {

if (a[i-1] < 0) a[i] = 1;

}

Control dependence also avoids parallelism to being exploited. Compilers are used to eliminate this control dependence and exploit the parallelism.

Resource dependence:

Data and control dependencies are based on the independence of the work to be done. Resource independence is concerned with conflicts in using shared resources, such as registers, integer and floa�ng point ALUs, etc. ALU conflicts are called ALU dependence. Memory (storage) conflicts are called storage dependence.

Hardware and So�ware Parallelism

Hardware parallelism is defined by machine architecture and hardware mul�plicity i.e., func�onal parallelism �mes the processor parallelism .It can be characterized by the number of instruc�ons that can be issued per machine cycle. If a processor issues k instruc�ons per machine cycle, it is called a k-issue processor. Conven�onal processors are one-issue machines. This provides the user the informa�on about peak a�ainable performance.

So�ware Parallelism

So�ware parallelism is defined by the control and data dependence of programs, and is revealed in the program’s flow graph i.e., it is defined by dependencies within the code and is a func�on of algorithm, programming style, and compiler op�miza�on.

Program par��oning and scheduling

Scheduling and alloca�on is a highly important issue since an inappropriate scheduling of tasks can fail to exploit the true poten�al of the system and can offset the gain from paralleliza�on, A parallel program, therefore, can be represented by a node- and edge-weighted directed acyclic graph (DAG), in which the node weights represent task processing �mes and the edge weights represent data dependencies as well as the communica�on �mes between tasks. In dynamic scheduling only, a few assump�ons about the parallel program can be made before execu�on, and thus, scheduling decisions have to be made on-the-fly. The goal of a dynamic scheduling algorithm as such includes not only the minimiza�on of the program comple�on �me but also the minimiza�on of the scheduling overhead which cons�tutes a significant por�on of the cost paid for running the scheduler. In general dynamic scheduling is an NP hard problem.

Grain size and latency

It corresponds to execu�on of essen�ally independent jobs or programs on a parallel computer. This is prac�cal for a machine with a small number of powerful processors, but imprac�cal for a machine with a large number of simple processors (since each processor would take too long to process a single job).

Communica�on Latency

Balancing granularity and latency can yield be�er performance. Various latencies a�ributed to machine architecture, technology, and communica�on pa�erns used. Latency imposes a limi�ng factor on machine scalability. Ex. Memory latency increases as memory capacity increases, limi�ng the amount of memory that can be used with a given tolerance for communica�on latency.

Inter-processor Communica�on Latency

  • Needs to be minimized by system designer
  • Affected by signal delays and communica�on pa�erns Ex. n communica�ng tasks may require n (n - 1)/ 2 communica�on links, and the complexity grows quadra�cally, effec�vely limi�ng the number of processors in the system.

Communica�on Pa�erns

  • Determined by algorithms used and architectural support provided
  • Pa�erns include permuta�ons broadcast mul�cast conference
  • Tradeoffs o�en exist between granularity of parallelism and communica�on demand.

Program Graphs and Packing

A program graph is similar to a dependence graph Nodes = { (n,s) }, where n = node name, s = size (larger s = larger grain size).

Edges = {(v, d)}, where v = variable being “communicated,” and d = communica�on delay.

Packing two (or more) nodes produces a node with a larger grain size and possibly more edges to other nodes. Packing is done to eliminate unnecessary communica�on delays or reduce overall scheduling overhead.

Scheduling

A schedule is a mapping of nodes to processors and start �mes such that communica�on delay requirements are observed, and no two nodes are execu�ng on the same processor at the same �me. Some general scheduling goals:

  • Schedule all fine-grain ac�vi�es in a node to the same processor to minimize communica�on delays.
  • Select grain sizes for packing to achieve be�er schedules for a par�cular parallel machine.
  • Node Duplica�on

Grain packing may poten�ally eliminate interprocessor communica�on, but it may not always produce a shorter schedule. By duplica�ng nodes (that is, execu�ng some instruc�ons on mul�ple processors), we may eliminate some interprocessor communica�on, and thus produce a shorter schedule.

Program flow mechanism

Conven�onal machines used control flow mechanism in which order of program execu�on explicitly stated in user programs. Dataflow machines which instruc�ons can be executed by determining operand availability.

Data Flow Features

No need for shared memory program counter control sequencer Special mechanisms are required to detect

data availability match data tokens with instruc�ons needing them enable chain reac�on of asynchronous instruc�on execu�on

A Dataflow Architecture – 1 The Arvind machine (MIT) has N PEs and an N -by –N interconnec�on network. Each PE has a token-matching mechanism that dispatches only instruc�ons with data tokens available. Each datum is tagged with

  • address of instruc�on to which it belongs
  • context in which the instruc�on is being executed

Tagged tokens enter PE through local path (pipelined), and can also be communicated to other PEs through the rou�ng network. Instruc�on addresses effec�vely replace the program counter in a control flow machine. Context iden�fier effec�vely replaces the frame base register in a control flow machine. Since the dataflow machine matches the data tags from one instruc�on with successors, synchronized instruc�on execu�on is implicit.

Demand-Driven Mechanisms

Data-driven machines select instruc�ons for execu�on based on the availability of their operands; this is essen�ally a bo�om-up approach.

Demand-driven machines take a top-down approach, a�emp�ng to execute the instruc�on (a demander) that yields the final result. This triggers the execu�on of instruc�ons that yield its operands, and so forth. The demand-driven approach matches naturally with func�onal programming languages (e.g. LISP and SCHEME).

Pa�ern driven computers: An instruc�on is executed when we obtain a par�cular data pa�erns as output. There are two types of pa�ern driven computers

String-reduc�on model: each demander gets a separate copy of the expression string to evaluate each reduc�on step has an operator and embedded reference to demand the corresponding operands each operator is suspended while arguments are evaluated

Graph-reduc�on model: expression graph reduced by evalua�on of branches or sub-graphs, possibly in parallel, with demanders given pointers to results of reduc�ons. Based on sharing of pointers to arguments; traversal and reversal of pointers con�nues un�l constant arguments are encountered.

System interconnect architecture

Various types of interconnec�on networks have been suggested for SIMD computers. These are basically classified have been classified on network topologies into two categories namely

  • Sta�c Networks
  • Dynamic Networks

Sta�c versus Dynamic Networks

The topological structure of an SIMD array processor is mainly characterized by the data rou�ng network used in interconnec�ng the processing elements.

The topological structure of an SIMD array processor is mainly characterized by the data rou�ng network used in the interconnec�ng the processing elements.

Network proper�es and rou�ng

The goals of an interconnec�on network are to provide low-latency high data transfer rate wide communica�on bandwidth. Analysis includes latency bisec�on bandwidth data- rou�ng func�ons scalability of parallel architecture These Network usually represented by a graph with a finite number of nodes linked by directed or undirected edges.

Sta�c interconnec�on networks

Sta�c interconnec�on networks for elements of parallel systems (ex. processors, memories) are based on fixed connec�ons that cannot be modified without a physical re-designing of a system. Sta�c interconnec�on networks can have many structures such as a linear structure (pipeline), a matrix, a ring, a torus, a complete connec�on structure, a tree, a star, a hyper-cube.

In linear and matrix structures, processors are interconnected with their neighbors in a regular structure on a plane. A torus is a matrix structure in which elements at the matrix borders are connected in the frame of the same lines and columns. In a complete connec�on structure, all elements (ex. processors) are directly interconnected (point-to-point)

Figure 1.11: Linear structure (pipeline) of interconnec�ons in a parallel system

Figure 1.12: 2D Torus Figure 1.13: Matrix

Figure 1.14: A complete interconnec�on Figure 1.15: A Ring Figure 1.16: A Chordal Ring

In a tree structure, system elements are set in a hierarchical structure from the root to the leaves, see the figure below. All elements of the tree (nodes) can be processors or only leaves are processors and the rest of nodes are linking elements, which intermediate in transmissions. If from one node, 2 or more connec�ons go to different nodes towards the leaves - we say about a binary or k-nary tree. If from one node, more than one connec�on goes to the neighboring node, we speak about a fat tree. A binary tree, in which in the direc�on of

the root, the number of connec�ons between neighboring nodes increases twice, provides a uniform transmission throughput between the tree levels, a feature not available in a standard tree.

Figure 1.17: Binary tree Figure 1.18: Fat tree

In a hypercube structure, processors are interconnected in a network, in which connec�ons between processors correspond to edges of an n-dimensional cub.

Dynamic interconnec�on networks

Dynamic interconnec�on networks between processors enable changing (reconfiguring) of the connec�on structure in a system. It can be done before or during parallel program execu�on. So, we can speak about sta�c or dynamic connec�on reconfigura�on.

The dynamic networks are those networks where the route through which data move from one PE to another is established at the �me communica�on has to be performed. Usually all processing elements are equidistant and an interconnec�on path is established when two processing element want to communicate by use of switches. Such systems are more difficult to expand as compared to sta�c network. Examples: Bus-based, Crossbar, Mul�stage Networks. Here the Rou�ng is done by comparing the bit-level representa�on of source and des�na�on addresses. If there is a match goes to next stage via pass- through else in case of it mismatch goes via cross-over using the switch.

There are two classes of dynamic networks namely

  • single stage network
  • mul� stage

Single Stage Networks

A single stage switching network with N input selectors (IS) and N output selectors (OS). Here at each network stage there is a 1- to-D demul�plexer corresponding to each IS such that 1<D<N and each OS is an M-to- mul�plexer such that 1<M<=N. Cross bar network is a single stage network with D=M=N. In order to establish a desired connec�ng path different path control signals will be applied to all IS and OS selectors. The single stage network is also called as re-circula�ng network as in this network connec�on the single data items may have to re-circulate several �me through the single stage before reaching their final des�na�ons.

Mul�stage Networks

Many stages of interconnected switches form a mul�stage SIMD network. It is basicaaly consist of three characteris�c features

  • The switch box,
  • The network topology
  • The control structure

Many stages of interconnected switches form a mul�stage SIMD networks. Eachbox is essen�ally an interchange device with two inputs and two outputs. The four possible states of a switch box are which are shown in figure.

  • Straight
  • Exchange
  • Upper Broadcast
  • Lower broadcast.

A two func�on switch can assume only two possible state namely state or exchange states. However a four func�on switch box can be any of four possible states. A mul�stage network is capable of connec�ng any input terminal to any output terminal. Mul�-stage networks are basically constructed by so called shuffle- exchange switching element, which is basically a 2 x 2 crossbar. Mul�ple layers of these elements are connected and form the network.

Figure 1.19: A two-by-two switching box and its four interconnec�on states

A mul�stage network is capable of connec�ng an arbitrary input terminal to an arbitrary output terminal.

Bus networks

A bus is the simplest type of dynamic interconnec�on networks. It cons�tutes a common data transfer path for many devices. Depending on the type of implemented transmissions we have serial busses and parallel busses. The devices connected to a bus can be processors, memories, I/O units, as shown in the figure below.

Figure 1.20: A diagram of a system based on a single bus Figure 1.21: A diagram of a system based on a mul�bus

Only one device connected to a bus can transmits data. Many devices can receive data. In the last case we speak about a mul�cast transmission. If data are meant for all devices connected to a bus we speak about a broadcast transmission. Accessing the bus must be synchronized. It is done with the use of two methods: a token method and a bus arbiter method. With the token method, a token (a special control message or signal) is circula�ng between the devices connected to a bus and it gives the right to transmit to the bus to a single device at a �me.

UNIT-

Instruc�on Set Architectures

The instruc�on set, also called instruc�on set architecture (ISA), is part of a computer that pertains to programming, which is basically machine language. The instruc�on set provides commands to the processor, to tell it what it needs to do. The instruc�on set consists of addressing modes, instruc�ons, na�ve data types, registers, memory architecture, interrupt, and excep�on handling, and external I/O.

Examples of instruc�on set

  • ADD - Add two numbers together.
  • COMPARE - Compare numbers.
  • IN - Input informa�on from a device, e.g., keyboard.
  • JUMP - Jump to designated RAM address.
  • LOAD - Load informa�on from RAM to the CPU.
  • OUT - Output informa�on to device, e.g., monitor.
  • STORE - Store informa�on to RAM.

Computers are classified on the basis on instruc�on set they have as:

CISC Scalar Processors

CISC (Complex Instruc�on Set Computer): CISC based computer will have shorter programs which are made up of symbolic machine language. A Complex Instruc�on Set Computer (CISC) supplies a large number of complex instruc�ons at the assembly language level. During the early years, memory was slow and expensive and the programming was done in assembly language. Since memory was slow and instruc�ons could be retrieved up to 10 �mes faster from a local ROM than from main memory, programmers tried to put as many instruc�ons as possible in a microcode.

Figure 2.1: (a) CSIC Architecture (b) RSIC Architecture

RISC Scalar Processors

RISC (Reduced Instruc�on Set Computer): RISC is a type of microprocessor that has a rela�vely limited number of instruc�ons. It is designed to perform a smaller number of types of computer instruc�ons so that it can operate at a higher speed (perform more million instruc�ons per second, or millions of instruc�ons per second). Earlier, computers used only 20% of the instruc�ons, making the other 80% unnecessary. One advantage of reduced instruc�on set computers is that they can execute their instruc�ons very fast because the instruc�ons are so simple.

Advantages:

  • Speed: Since a simplified instruc�on set allows for a pipelined, superscalar design RISC processors o�en achieve 2 to 4 �mes the performance of CISC processor using comparable semiconductor technology and the same clock rates.
  • Simpler Hardware : Because the instruc�on set of a RISC processor is so simple, it uses up much less chip space; extra func�ons, such as memory management units or floa�ng point arithme�c units, can also be placed on the same chip. Smaller chips allow a semiconductor manufacturer to place more parts on a single silicon wafer, which can lower the per-chip cost drama�cally.

Difference between CISC and RISC

VLIW Architecture

Very long instruc�on word (VLIW) describes a computer processing architecture in which a language compiler or pre-processor breaks program instruc�on down into basic opera�ons that can be performed by the processor in parallel (that is, at the same �me).

VLIW is some�mes viewed as the next step beyond the reduced instruc�on set compu�ng (RISC) architecture, which also works with a limited set of rela�vely basic instruc�ons and can usually execute more than one instruc�on at a �me (a characteris�c referred to as superscalar ).

The main advantage of VLIW processors is that complexity is moved from the hardware to the so�ware, which means that the hardware can be smaller, cheaper, and require less power to operate.

Figure 2.2: A VLIW processor architecture and instruc�on format Figure 2.3: Pipeline execu�on

Pipelining in VLIW Processors

Decoding of instruc�ons is easier in VLIW than in superscalars, because each “region” of an instruc�on word is usually limited as to the type of instruc�on it can contain.

VLIW Opportuni�es

“Random” parallelism among scalar opera�ons is exploited in VLIW, instead of regular parallelism in a vector or SIMD machine.

The efficiency of the machine is en�rely dictated by the success, or “goodness,” of the compiler in planning the opera�ons to be placed in the same instruc�on words.

Different implementa�ons of the same VLIW architecture may not be binary-compa�ble with each other, resul�ng in different latencies.

Memory Hierarchy

of references. Frequently used informa�on is found in the lower levels in order to minimize the effec�ve access �me of the memory hierarchy.

Figure 2.5: The inclusion property and data transfer between adjacent levels

The following three principles which led to an effec�ve implementa�on memory hierarchy for a system are:

1 Make the Common Case Fast: This principle says the data which is more frequently used should be kept in faster device. It is based on a fundamental law, called Amdahl’s Law, which states that the performance improvement to be gained from using some faster mode of execu�on is limited by the frac�on of the �me the faster mode can be used. Thus if faster mode use rela�vely less frequent data then most of the �me faster mode device will not be used hence the speed up achieved will be less than if faster mode device is more frequently used.

2. Principle of Locality: It is very common trend of Programs to reuse data and instruc�ons that are used recently. Based on this observa�on comes important program property called locality of references: the instruc�ons and data in a program that will be used in the near future is based on its accesses in the recent past. There is a famous 40/10 rule that comes from empirical observa�on is:

"A program spends 40% of its �me in 10% of its code"

These locali�es can be categorized of three types :

a. Temporal locality : states that data items and code that are recently accessed are likely to be accessed in the near future. Thus if loca�on M is referenced at �me t, then it (loca�on M) will be referenced again at some �me t+Dt.

b. Spa�al locality : states that items try to reside in proximity in the memory i.e., the items whose addresses are near to each other are likely to be referred together in �me. Thus we can say memory accesses are clustered with respect to the address space. Thus if loca�on M is referenced at �me t, then another loca�on M±Dm will be referenced at �me t+Dt.

c. Sequen�al locality: Programs are stored sequen�ally in memory and normally these programs has sequen�al trend of execu�on. Thus we say instruc�ons are stored in memory in certain array pa�erns and are accessed sequen�ally one memory loca�ons a�er another. Thus if loca�on M is referenced at �me t, then loca�ons M+1, M+2, … will be referenced at �me t+Dt, t+Dt’, etc. In each of these pa�erns, both Dm and Dt are “small.” H&P suggest that 90 percent of the execu�on �me in most programs is spent execu�ng only 10 percent of the code.

3. Smaller is Faster: Smaller pieces of hardware will generally be faster than larger pieces.

This according to above principles suggested that one should try to keep recently accessed items in the fastest memory. While designing the memory hierarchy following points are always considered

Inclusion property: If a value is found at one level, it should be present at all of the levels below it.

The implica�on of the inclusion property is that all items of informa�on in the “innermost” memory level (cache) also appear in the outer memory levels. The inverse, however, is not necessarily true. That is, the presence of a data item in level Mi+1 does not imply its presence in level Mi. We call a reference to a missing item a “miss.”

The Coherence Property

The value of any data should be consistent at all level. The inclusion property is, of course, never completely true, but it does represent a desired state. That is, as informa�on is modified by the processor, copies of that informa�on should be placed in the appropriate loca�ons in outer memory levels. The requirement that copies

of data items at successive memory levels be consistent is called the “coherence property.”

Coherence Strategies

Write-through

As soon as a data item in M i is modified, immediate update of the corresponding data item(s) in M i+1, Mi+ … Mn is required. This is the most aggressive (and expensive) strategy.

Write-back

The update of the data item in M i+1 corresponding to a modified item in Mi is not updated unit it (or the block/page/etc. in M i that contains it) is replaced or removed. This is the most efficient approach, but cannot be used (without modifica�on) when mul�ple processors share Mi+1, …, Mn.

Memory Capacity Planning:

The performance of a memory hierarchy is determined by the effec�ve access �me (Teff) to any level in the hierarchy. It depends on the hit ra�o and access frequencies at successive levels.

Hit Ra�o (h): is a concept defined for any two adjacent levels of a memory hierarchy. When an informa�on item found in Mi, it is a hit, otherwise, a miss. The hit ra�o (hi) at Mi is the probability that an informa�on item will be found in Mi. the miss ra�o at Mi is defined as 1-hi.

The access frequency to Mi is defined as

fi= (1-h1)(1-h2)….(1-hi)

Effec�ve Access Time (Teff):

In prac�ce, we wish to achieve as high a hit ra�o as possible at M1. Every �me a miss occurs, a penalty must be paid to access the next higher level of memory. The Teff of a memory hierarchy is given by:

n

T (^) eff. =∑ f (^) i .t (^) i

i=

=h 1 t 1 + (1-h 1 ) h^2 t 2 + (1-h^1 ) (1-h 2 ) h 3 t 3 +………+ (1-h 1 ) (1-h 2 )…… (1-h^ n-1) t^ n

Hierarchy Op�miza�on:

The total cost of a memory hierarchy is es�mated as:

n

C (^) total=∑ C (^) i .S (^) i

i=

Interleaved memory organiza�on- memory interleaving

It is a technique for compensa�ng the rela�vely slow speed of DRAM (Dynamic RAM). In this technique, the main memory is divided into memory banks which can be accessed individually without any dependency on the other.

High-Order Interleaving

Arguably the most “natural” arrangement would be to use bus lines A26-A27 as the module determiner. In other words, we would feed these two lines into a 2-to-4 decoder, the outputs of which would be connected to the Chip Select pins of the four memory modules. If we were to do this, the physical placement of our system addresses would be as follows: