All pastes #78214 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-07-03 22:14 UTC
rendered paste body
4.2
Extend the src instruction set by adding the instruction swap ra, rb, (op = 7), that exchanges the contents of the two specified registers. (4.4)
a. Define a plausible abstract rtn for this instruction
Answer: swap (:=op=7) -> R[rb] <- R[ra]: R[ra] <- R[rb]

b. Develop the concrete RTN for it, assuming the 1-bus SRC micro architecture
Answer:
T0	MA <- PC: C <- PC + 4;
T1	MD <- M[MA]: PC <- C;
T2	IR <- MD;
T3	A <- R[ra];
T4	B <- R[rb];
T5	R[rb] <- A;
T6	R[ra] <- B;