Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Similar to above, but least significant 5-bits of $6 determine the amount to rotate.ror  $4, $5, $6
$4 rotate right $5 by 3 positionsbror  $4, $5, 3
Similar to above, but least significant 5-bits of $6 determine the amount to rotate.rol  $4, $5, $6
$4 rotate left $5 by 3 positionsbrol  $4, $5, 3
Similar to sra, but least significant 5-bits of $6 determine the amount to shift.srav  $4, $5, $6
$4 shift right $5 by 3 positions.  Sign-extend  (shift in sign bit)bsra $4, $5, 3
Similar to srl, but least significant 5-bits of $6 determine the amount to shift.srlv $4, $5, $6
$4  shift right $5 by 3 positions.  Shift in zerosbsrl  $4, $5, 3
Similar to sll, but least significant 5-bits of $6 determine the amount to shift.sllv  $4, $5, $6
$4 shift left $5 by 3 positions.  Shift in zeros  (only least significant 5-bits of immediateb
value are used to shift)
sll  $4, $5, 3
MIPS Shift and Rotate Instructions
1.  To calculate the address element array[i], we calculate (base address of array) + i * 4 for an array of words.
Since multiplying is a slow operation, what shift instruction can be used instead?  Modify the sample code:
mul $10, $2, 4   # $2 contains i
add  $10, $3, $10 # $3 contains the base address of array
lw  $4, 0($10)
2.  If $5 contains 0xAF000A5D and $6 contained 0x6, what hexadecimal value would be in $4 after each of the
following?
a)  sll  $4, $5, 3
b)  sllv  $4, $5, $6
c)  srl  $4, $5, 3
d)  srlv $4, $5, $6
e)  sra $4, $5, 3
f)  srav  $4, $5, $6
g)  rol  $4, $5, 3
h)  rol  $4, $5, $6
i)  ror  $4, $5, 3
j)  ror  $4, $5, $6
3/9/06
$4 NOT $5       #inverts all the bitsbnot  $4, $5
$4 $5 (bit-wise NOR) $6bnor  $4, $5, $6
$4 $5 (bit-wise Exclusive-OR) 5f16bxori  $4, $5, 0x5f
$4 $5 (bit-wise Exclusive-OR) $6bxor  $4, $5, $6
$4 $5 (bit-wise OR) 5f16bori  $4, $5, 0x5f
$4 $5 (bit-wise OR) $6bor  $4, $5, $6
$4 $5 (bit-wise AND) 5f16bandi  $4, $5, 0x5f
$4 $5 (bit-wise AND) $6band  $4, $5, $6
MIPS Logical Instructions
3.  If $5 contains 0xA5D and $6 contained 0x63C, what hexadecimal value would be in $4 after each of the
following?
a)  and  $4, $5, $6
b)  andi  $4, $5, 0xBF
c)  or  $4, $5, $6
d)  ori  $4, $5, 0xBF
e)  xor  $4, $5, $6
f)  xori  $4, $5, 0xBF
g)  nor  $4, $5, $6
h)  not  $4, $5
3/9/06