Professional Documents
Culture Documents
Microprocessor Based Systems: Lecture No 05 Virtual Machines and Pipelining Concept
Microprocessor Based Systems: Lecture No 05 Virtual Machines and Pipelining Concept
Systems
Lecture No 05 Virtual Machines and
Pipelining Concept
By Nasir Mahmood
Overview of Last Lecture
ISA
Describes the processor at a logical level
Difference Between RISC and CISC
Architectures
CISC controlled by micro-programmed control
Why to write programs in Assembly Language
More optimization and efficient code
Harvard Architecture Versus Von Neumann
Architecture
In Harvard Architectures separate instructions and data
paths, in Von Neumann it has common paths
Assembly Language & Machine
Language
Machine language is a numeric language specifically understood by a
computer’s processor (the CPU). IA-32–compatible processors
understand a common machine language.
3
A comparison
C++ Assembly Language
mov eax,Y
int Y; add eax,4
int X = (Y + 4) * 3; mov ebx,3
imul ebx
mov X,eax
4
Comparison of Assembly Language to
High-Level Languages
5
Virtual Machine Concept
6
Virtual Machines 0 thru 5
Level 0 represents the Digital
Logic Hardware
Level 1 is an interpreter
hardwired into the processor
Level 2 is the 1st level where
user can write programs but it
consists only of 0 & 1s
7
Levels of Representation
temp = v[k];
High Level Language v[k] = v[k+1];
Program
v[k+1] = temp;
Compiler
lw $15, 0($2)
Assembly Language
Program lw $16, 4($2)
sw $16, 0($2)
Assembler sw $15, 4($2)
0000 1001 1100 0110 1010 1111 0101 1000
Machine Language 1010 1111 0101 1000 0000 1001 1100 0110
Program 1100 0110 1010 1111 0101 1000 0000 1001
0101 1000 0000 1001 1100 0110 1010 1111
Machine Interpretation
Execution Unit
Segment Unit
Paging Unit
Six Stage Non-pipelined
Execution
11
Pipelining contd….
12
Six Stage Pipelined Execution
13
Pipelining - Throughput
In an automobile assembly line, throughput is defined as No.
of cars / hour & determined by how often a completed car
exits assembly line. Likewise, the throughput of an instruction
pipeline is determined by how often an instruction exits the
pipeline.
The time required b/w moving an instruction one step down
the pipeline is a processor cycle.
As all stages proceed at the same time, the length of a
processor cycle is determined by the time required for the
slowest pipe stage. In a computer, this cycle is usually 1 clock
cycle or 1 tick.
14
Superscalar Architecture
If execution stage requires more than one cycle then we have wasted
cycles
In general, for k stages (where one stage requires two cycles), n
instructions require (k +2n - 1) cycles to process.
16
Superscalar 6-Stage Pipelined
Processor
17
Summary
Assembly Language & Machine Language
How the translation is done
Compiler, Assembler, OS
Multistage Pipeline Concept
Concept of Stages and cycles execution
Make the execution fast by parallel pipelines
Superscalar Processor
THE END