Given t00xBEADFEED what is the value of t2 for the following

Given $t0=0xBEADFEED, what is the value of $t2 for the following sequence of instructions: sll $t2, $t0, 4 andi $t2, $t2, -1

Solution

$to =0xBEADFEED = 1011 1110 1010 1101 1111 1110 1110 1101

1) Instruction : sll $t2,$t0,4

after instruction ( shifting 4 bits to left)

$t2 = 1011 1110 1010 1101 1111 1110 1110 1101 << 4

$t2 = 1110 1010 1101 1111 1110 1110 1101 0000 = 0xEADFEED0

2) instruction : andi $t2,$t2,-1

instruction : andi $t2,$t2,-1
$t2= 1110 1010 1101 1111 1110 1110 1101 0000
-1= 1111 1111 1111 1111 1111 1111 1111 1111

andi=1110 1010 1101 1111 1110 1110 1101 0000 = 0xEADFEED0 = -354423088 = $t2

 Given $t0=0xBEADFEED, what is the value of $t2 for the following sequence of instructions: sll $t2, $t0, 4 andi $t2, $t2, -1Solution$to =0xBEADFEED = 1011 1110

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site