CS 61C (Fall 2007)

Quiz 11

Two questions, submit as "quiz11".  Due 2:45pm before lecture 9/24/2007.


1.

Write a sequence of one or more MIPS instructions which will perform logical NOT on $s0 (putting the result back in $s0). You may use the $t? registers as needed.  You may not use branches.  You should use as few instructions as necessary.
By "logical not" we mean the C operator ! as opposed to ~, which performs "bit-wise not" or "bit-by-bit not". Logical not will convert 0 into 1, and anything other than 0 into 0.

2.

Write a single instruction implementation of "bit-wise not" or "bit-by-bit not" (the C ~ operator) of $s0 which does not use $0. Hint: you don't have to change much from the instruction given in P&H for performing bit-wise not.