Wednesday, 27 April 2011

Spring 2011_CS501_2 Sol.doc

check this soltion of Cs501 assignmetn number 02

Q#01

Specify the condition for the branch instruction and the status of the PC after the branch instruction executes with a true branch condition.

solution


































InstructionConditionPC status
Jump[20]AlwaysPC← PC+20
Jnz r3,[33]If R[3] ≠ 0PC← PC+33
Jz r1,[16]If R[1] = = 0PC← PC+16
Jpl r5,[37]If R[5] ≥0PC← PC+37
Jmi r7,[40]If R[7] < 0PC← PC+40

Q#02

Identify the addressing modes and Register Transfer Language(RTL) description(meaning) for the given Falcon-A instructions

solution

































InstructionAddressing ModeRTL description(meaning)
Load r3,[r5+27]DisplacementR[3] ← M[R[5] +27]
Jnz r5,[15]Relative(If R[5] ≠ 0): PC← PC+15
Shiftl r3,r2,5ImmediateShift r3 left 6 times and store in r2
Add r6,r5,r7RegisterR[6] ← R[5] + R[7]
Subi r4,r3,17ImmediateR[4] ← R[3] -17

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More