Lecture 6
Branch Prediction
1
Why do we want to predict branches?
MIPS based pipeline 1 instruction issued per cycle, branch
hazard of 1 cycle.
Delayed branch
Modern processor and next generation multiple instructions
issued per cycle, more branch haza

Advanced Branch Prediction
Prof. Mikko H. Lipasti
University of Wisconsin-Madison
Lecture notes based on notes by John P. Shen
Updated by Mikko Lipasti
Advanced Branch Prediction
Control Flow Speculation
Branch Speculation
Mis-speculation Recovery
Bra

RISC and CISC
What is CISC?
CISC means Complex Instruction Set Computer and are chips
that are easy to program and which make efficient use of memory.
Since the earliest machines were programmed in assembly
language and memory was slow and expensive, the

Measurement Tools
Measurement Tools
Benchmarks, Traces, Mixes
Hardware: Cost, delay, area, power estimation
Simulation (many levels)
ISA, RT, Gate, Circuit
Queuing Theory
Rules of Thumb
Fundamental Laws/Principles
Computer Architects and Quantitati

Instruction Level
Parallelism ILP
Definition
All processors use pipelining to overlap
the execution of instruction and to
improve the performance. This potential
overlap
among
instructions
is
Instruction-Level Parallelism
Approaches
There are two largely

Branch Prediction
Basic compiler techniques for
Exposing ILP
Simple compiler technology to enhance
processors ability to exploit ILP
These processor use Static issues and Static
scheduling
Basic pipeline scheduling and
Loop Unrolling
Scheduling:
To ke

ITA525
2
Algorithm: Outline, the essence of a
computational procedure, step-by-step
instruction.
Program: An implementation of an algorithm
in some programming language
Data Structure: Organization of data needed
to solve the problem
Data Structure:
a sy

Hashing
Searching
Consider the problem of searching an array for a
given value
If the array is not sorted, the search requires O(n) time
If the value isnt there, we need to search all n elements
If the value is there, we search n/2 elements on average

TREES
Tree Data Structure Syllabus
Outline
Binary Tree
Tree traversals
Expression and search trees
AVL Tree
Tree
Definition of Tree
A tree is a finite set of one or more nodes
such that:
There is a specially designated node called
the root.
The remaining

Graphs
What is a Graph?
A graph G = (V,E) is composed of:
V: set of vertices
E: set of edges connecting the vertices in V
An edge e = (u,v) is a pair of vertices
Example:
a
b
V= cfw_a,b,c,d,e
E= cfw_(a,b),(a,c),(a,d),
(b,e),(c,d),(c,e),
(d,e)
c
d
e
Applic

Insertion, selection and bubble sort have
quadratic worst-case performance
The faster comparison based algorithm ?
O(nlogn)
Mergesort and Quicksort
Given an array of n elements (e.g., integers):
If array only contains one element, return
Else
pick one

Linked Lists
Lists
List: a finite sequence of data items
a1, a2, a3, , an
Lists are pervasive in computing
e.g. class list, list of chars, list of events
Typical operations:
9/10/2015
Creation
Insert / remove an element
Test for emptiness
Find an item

Minimum Spanning Trees
Definition
A Minimum Spanning Tree (MST) is a
subgraph of an undirected graph such that
the subgraph spans (includes) all nodes, is
connected, is acyclic, and has minimum
total edge weight
Algorithm Characteristics
Both Prims and

Stack
Stores a set of elements in a particular order
Stack principle: LAST IN FIRST OUT = LIFO
It means: the last element inserted is the first one to be
removed
Example
Last In First Out
top
top
A
top
B
A
top
C
B
A
top
D
C
B
A
E
D
C
B
A
D
C
B
A
Stack

Polynomial
What is it? (Recall it from mathematics)
An example of a single variable
polynomial:
4x6 + 10x4 - 5x + 3
Remark: the order of this polynomial is 6
(look for highest exponent)
Polynomial
A single variable polynomial can be
generalized as:
Po