作者mickeyha (M*schief)
看板Grad-ProbAsk
标题[理工] [计组] 99台联大电机
时间Mon Jul 11 23:51:22 2011
Assume three 32-bit variables x, y, and z, are stored in memory
with address A, B and C, respectively.
(1)For the "load-store" instruction set architecture processor,
write down the assembly codes to compute x+y-z and then stores
the result back to C.
(2)Suppose that all instruction operation codes are 6 bits,
memory address are 24 bits(byte-addressable),
and register address are 5 bits.
What are the code size(in terms of bits) and
the total memory access
(in terms of bytes) for the codes in(1)?
Note that the total memory access include both instructions and data
moves to or from memory.
And, the memory access must be aligned.
我标黄色的地方真的不太会算 >____<
写出指令还OK
lw $s1,A
lw $s2,B
lw $s3,C
add $t1,$s1,$s2
sub $t2,$t1,$s3
sw $t2,C
跪求强者解答 ︿( ̄︶ ̄)︿
--
Why Not :-P
http://whynot-p.blogspot.com/
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.224.51.5
1F:推 kiwidoit:4 07/12 10:31
2F:→ kiwidoit:3 loadword operations + 1 storeword operations,thus=4 07/12 10:32
3F:→ mickeyha:感恩:))) 只是我不会算Byte数耶XD 像是第一行 07/12 12:35
4F:→ mickeyha:答案写 8+4 =12 byte 请问是为什麽呢 07/12 12:36
5F:推 kiwidoit:24 address memory bits/8 bits(a byte)=3 byte per 07/12 13:15
6F:→ kiwidoit:memory access. 4 memory access=3*4=12bytes. 07/12 13:16