Docsity

Additional Problems for Computer Architecture and Organization | ECE 337, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
ECE337 / CS341, Fall 2005
Introduction to Computer Architecture and Organization
Additional Problems
1)
a. If the last operation performed on a computer with an 8-bit word was an
addition in which the two operands were 2 and 3, what would be the value of the
following flags: carry, zero, overflow, sign, even parity, and half-carry.
b. What if the operands were -1 (two’s complement) and +1?
2)
Consider the timing diagram of the below figure. Assume that there is only a two-
stage pipeline (fetch, execute). Redraw the diagram to show how many time
units are now needed for four instructions.
pf3

Partial preview of the text

Download Additional Problems for Computer Architecture and Organization | ECE 337 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

ECE337 / CS341, Fall 2005 Introduction to Computer Architecture and Organization

Additional Problems

1) a. If the last operation performed on a computer with an 8-bit word was an addition in which the two operands were 2 and 3, what would be the value of the following flags: carry, zero, overflow, sign, even parity, and half-carry. b. What if the operands were -1 (two’s complement) and +1?

2) Consider the timing diagram of the below figure. Assume that there is only a two- stage pipeline (fetch, execute). Redraw the diagram to show how many time units are now needed for four instructions.

Pipeline

Suppose that the following program will be executed using a 32-bit processor, with 16MB RAM. The processor has a 5-subcycle pipeline (IF, ID, EX, MEM, and WB):

ADD R1,R0, ADD R2,R0,

R1 <= R0 + 1

R2 <= R0 + 2

JUMPING:

ADD R1,R1,R

SW R1,R3,

ADD R3,R3,

SUB R2,R2,

JG R2,R0,JUMPING

NOP

NOP

NOP

R1 <= R1 + R

(R3 + 0) <= R

R3 <= R3 + 4

R2 <= R2 – 1

GO TO “JUMPING” IF R2 > R

Where: R0, R1, R2, and R3 are the processor registers, and initially R0=0 and R3=0E1500H. IF: Instruction Fetch, ID: Instruction Decode, EX: Execute, MEM: Memory access, and WB: Write Back.

a. Calculate how many clock cycles are necessary to execute the program if the processor does not have pipeline. b. Calculate how many clock cycles are necessary to execute the program if the processor has pipeline, and the processor resolves dependency problems about the registers (the processor adds WS cycles –wait state-).