H**********5 发帖数: 2012 | 1 1
The memory (Big Endian) contains data as mapped below:
Address Byte0 Byte1 Byte2 Byte3
0 00 00 FF FF
4 55 AA AA 55
Register $s0 equals to 0 initially.
(1)After the instruction: lb $s1, 0($s0) execution, the content of $s1
becomes:
(2)After the instruction: lbu $s1, 0($s0) execution, the content of $s1
becomes:
2
What’s the 2’s complement of 0xffff0001 :
A. 0x7fff ffff
B. 0xffff 7fff
C. 0x0000 ffff
D. 0xffff 0000
E. None above
3
What’s the 2’s complement of 0x80000001 : | y*****1 发帖数: 53 | 2 第一题感觉都是0。读取的byte是0x00,不管是lb还是lbu应该都是用0来填充剩余的
bits。
剩下两题就是把所有位都反转一次,0变1,1变0再加1,应该是
错了的话求勿喷 | n**s 发帖数: 2230 | | H**********5 发帖数: 2012 | 4 后面两题:
你说的解法是针对最高位为0的正数,对应的负数求补码的解法。
0x8000 0001 它的最高位已经是1了,即本身就代表负数。
顺便八卦个笑话,这是今天quiz的题,
quiz之前instructor名文手机放口袋里,结果考试时有烙印三哥看手机,
当场被老师没收试卷,赶出了考场,我心里那个高兴呵呵呵呵呵呵呵呵
【在 y*****1 的大作中提到】 : 第一题感觉都是0。读取的byte是0x00,不管是lb还是lbu应该都是用0来填充剩余的 : bits。 : 剩下两题就是把所有位都反转一次,0变1,1变0再加1,应该是 : 错了的话求勿喷
|
|