Subject Computer Science Systems Architecture

Question

•jgz Sn,Tag
This instruction jumps to address Tag (this can be a valid address tag in the program) only if the content of Sn is greater than zero. Of course the comparison needed is made in the ALU. (execution cycle), and the PC update happens in the MEM stage (as with the jnez instruction).

•jmp Tag
This is called an unconditional jump. This instruction jumps to Tag (a valid address tag in the program). The PC is updated immediately at the IF step of the instruction (in contrast to conditional jumps) since there is no decision needed to be made.

• div Sn, Sk, Sl
This instruction devides the content of Sk with the content of Sl and stores the result in Sn. The pipelining of this instruction is similar to add, mul, sub but now we have division in the ALU.

a. Supposing that in the beginning of the execution of the program below S2 and S5 have value 50, give me the state of the machine during the execution of this program (register file, program counter and your assumptions for the memory contents when needed) for the first 2 executions of the loop. (Hint: I don’t want the pipelining here. Just show the changes in the register file, program counter and the memory after each instruction. Assume time = 0 before every instruction has been executed, time = 1 after the execution of the first instruction, etc. You can choose the values that are included in the memory addresses that are being read)

Start ld S1, 100(S2)
ld S3, 200(S2)
sub S4, S1, S3
sub S2, S2, 1
jgz S4, Division

Back jnez S2, Start
jmp Exit Division div S4, 1, S4
st S4,500(S5)
sub S5,S5,1
jmp Back
Exit

b. What does this program do? I don’t want you to write down all the snapshots but
just describe the result of the whole execution in 4 − 5 lines

c. Show the pipelining of the program without forwarding, until the first instruction of the second repetition. Assume that the numbers are such that the jump to Division
(jgz S4, Division ) is always happening. How many cycles does the program need in total (after 50 executions). How much faster is pipelined execution than not pipelined execution?

d. The same with c but now assume that the jump to Division is never happening.

e. Show the pipelining of the program with all possible forwardings. How many cycles does the program take now? How much faster is pipelined execution with forwarding than pipelined execution without forwarding? Assume that the jump to division is always happening.

f. The same with e but now assume that the jump to Division is never happening.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

a. Assume memory location 100(S2) = 10 and 200(S2) = 4
Time 0, S2 and S5 = 50
Time 1, LD S1, 100(S2), S1 = 10, S2 = S5 = 50
Time 2, LD S3, 200(S2), S1= 10, S3=4, S2=S5=50
Time 3, sub S4, S1, S3, S1 = 10, S2=S5=50, S3 = 4, S4 = 6
Time 4, sub S2, S2, S1, S1=10, S2 = 49, S3 = 4, S4 = 6, S5=50
Time 5, jgz S4, Divison, no changes to memory or registers...

This is only a preview of the solution. Please use the purchase button to see the entire solution

$25.00

or $1 if you
register a new account!

Related Homework Solutions

Systems Architecture Questions Involving CISC, RISC, and CPU Types
Homework Solution
$40.00
Multiprogramming
Multiprocessing
Multithreading
Assembly
Language
Development
Application
Program
Compiled
Interpreted
RISC
CISC
Register
Global
Windows
Input
Output
Local
Set
Indicate
Clock
Cycle
Execute
Fetch
Reference
Memory
C
Study Log on Distributed Systems Based on Tannenbaum's Book
Homework Solution
$70.00
Study
Log
Distributed
System
Tannebaum
Principle
Paradigm
Twenty
Concept
Overview
Architecture
Style
Pervasive
Centralized
Decentralized
Hybrid
Middleware
Interceptor
Thread
Virtualization
Client
Server
Code
Migration
Layer
Protoc
Computer Architecture, MARIE Language & CRC-Related Questions
Homework Solution
$18.00
Computer
Architecture
Instruction Format
Instruction Set
Bits
Size
Address Field
Zero-Address
One-Address
Two-Address
MARIE
CRC
Polynomial
Code
Word
Skipcond
Jump
Add
Load
Store
Subt
Halt
Dec
Get help from a qualified tutor
Live Chats