Show the execution of your program on the above pipelined processor for k = 6 by drawing a diagram. Assume that the fetched and decoded instructions are stored in an instruction window IW with unlimited capacity (and so you can store any number of instruction in the IW). Explain where and why delay slots Assume that the processor can do out-of-order execution to speed up the completion of the program. Assume that there is only one bus, and that the fetching of instructions uses this bus. So the fetching of an instruction can conflict with a stage where an instruction accesses memory.   A         Instruction Set Architecture A.1        Instruction set

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Quesion:

  • Show the execution of your program on the above pipelined processor for k = 6 by drawing a diagram. Assume that the fetched and decoded instructions are stored in an instruction window IW with unlimited capacity (and so you can store any number of instruction in the IW). Explain where and why delay slots Assume that the processor can do out-of-order execution to speed up the completion of the program. Assume that there is only one bus, and that the fetching of instructions uses this bus. So the fetching of an instruction can conflict with a stage where an instruction accesses memory.

 

A         Instruction Set Architecture

A.1        Instruction set

We present a list of instructions typical of a RISC (reduced instruction set computer) machine. In data-movement and control instructions, the addresses may be immediate #X, direct (memory) M, indirect (memory) [M], register r, or register indirect [r] addresses. Data-processing instructions use immediate or register addressing. PC is the programme counter and a <- b indicates that the value of b is placed in a.

 

 

LOAD a, b                    a <- b

STOR a, b                    a <- b

ADD a, b, c               a <- b + c

 

ASH a, b, c               a <- (b >>[s] c)

LSH a, b, c               a <- (b >>[u] c) BR a               PC <- a

 

SUB

a,

b,

c

a

<-

b

- c

BEQ

a,

b,

c

PC

<-

a

if

b =

c

MUL

a,

b,

c

a

<-

b

* c

BNE

a,

b,

c

PC

<-

a

if

not

b = c

DIV

a,

b,

c

a

<-

b

/ c

BLT

a,

b,

c

PC

<-

a

if

b <

c

AND

a,

b,

c

a

<-

b

& c

BGT

a,

b,

c

PC

<-

a

if

b >

c

 

OR a, b, c                 a <- b | c

NOT a, b                      a <- !b

 

BLE a, b, c               PC <- a if b <= c BGE a, b, c            PC <- a if b >= c

 

 

Note:  Here >>[s]  denotes the arithmetical shift of to the right by positions, and

>>[u]  denotes the logical shift of to the right by positions.

 

A.2       The pipeline

We will use a five-stage pipeline:

  • IF (instruction fetch),
  • ID (instruction decode),
  • RR (register read),
  • EX (execute instruction),
  • WB (write back result into register).
  • Note that for some instructions (e.g., LOAD r, #X) some of the pipeline stages (e.g., RR) are not

 

 

 

 

A.3       Execution rules

The rules for the execution of instructions are as follows:

  1. All instructions go through the IF and ID stages
  2. For data-movement instructions the data transfer between the CPU and main mem- ory happens in the execute stage. (This means that if a data transfer operation is executing, no data can be transferred across the main-memory )
  3. Immediate addressing for input arguments does not require RR or EX (e.g., LOAD r1, #X).
  4. Arithmetic and logic instructions need RR, EX and
  5. Branching operations require RR, EX and WB, unless all operands are immediate, in which case only EX and WB are
  6. For the instruction LOAD a, b the argument b must be an immediate address or memory location and a must be a
  7. For the instruction STOR a, b the argument b must be an immediate address or register and a must be a memory
  8. For each of the remaining instructions the arguments a, b and c must all be registers or immediate
  9. You may assume for the sake of the questions that the ISA supports floating point arithmetic with no loss of precision
Questions
1. The function L is defined as L(1) = 2,L(2) = 1,1(3) = 3,L(4) = 4 and for n 2 4,
Lin) + L(n – 1) + L(n – 2)
Ytn + 11
Lin - 3)
i.e., the (n + 1}-th value is given by the sum of the n-th, n-1-th and n– 2-th
values divided by the n-3-th value.
(a) Write an assembly program for computing the k-th value Lik), where k is
an integ er bigger than 4 and read from a memory location M, and storing L(k)
at memory location M. Use the instruction set in the Instruction Set
Architecture described in Appendix A.
(b) Consider a pipelined processor, where the pipeline stages are those
described in the appendix. Describe what ha ppens in the pipeline stages
for the various types (data movement, data processing, control) of
instructions.
(c) Show the execution of your program on the above pipelined processor for k
= 6 by drawing a diagram. Assume that the fetched and decoded instructions
are stored in an instruction window IW with unlimited capacity (and so
you can store any number of instruction in the IW). Explain where and why
delay slots appear.
execution to speed up the completion of the program. Assume that there
is only one bus, and that the fetching of instructions uses this bus. So the
fetching of an instruction can conflict with a stage where an instruc tion
Assum e that the processor
do out-of-order
can
accesses memory.
Transcribed Image Text:Questions 1. The function L is defined as L(1) = 2,L(2) = 1,1(3) = 3,L(4) = 4 and for n 2 4, Lin) + L(n – 1) + L(n – 2) Ytn + 11 Lin - 3) i.e., the (n + 1}-th value is given by the sum of the n-th, n-1-th and n– 2-th values divided by the n-3-th value. (a) Write an assembly program for computing the k-th value Lik), where k is an integ er bigger than 4 and read from a memory location M, and storing L(k) at memory location M. Use the instruction set in the Instruction Set Architecture described in Appendix A. (b) Consider a pipelined processor, where the pipeline stages are those described in the appendix. Describe what ha ppens in the pipeline stages for the various types (data movement, data processing, control) of instructions. (c) Show the execution of your program on the above pipelined processor for k = 6 by drawing a diagram. Assume that the fetched and decoded instructions are stored in an instruction window IW with unlimited capacity (and so you can store any number of instruction in the IW). Explain where and why delay slots appear. execution to speed up the completion of the program. Assume that there is only one bus, and that the fetching of instructions uses this bus. So the fetching of an instruction can conflict with a stage where an instruc tion Assum e that the processor do out-of-order can accesses memory.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY