Suppose a 16 bit register R is as shown.
1.
Show
the equivalent of R’s contents as:
A.
an
octal number
B.
a
hexidecimal number
C.
a
decimal number
D.
a
number expressed in base 7
2.
Give
two instructions that will cause a branch to a label named theLabel if
any one of bits 0, 4, or 6 are set.
3.
Give
an instruction to clear bits 6, 2, and 1. Show the resulting register in both
binary and hexidecimal notation.
4.
Give
a instruction to toggle bits 2, 4, and 5 of R. Show the btog command, and the
equivalent xnor. Show the result in hex, octal, and binary.
5.
Convert
34265 to decimal.
6.
Convert
326417 to base 3
7.
Convert
ABCB613 to base 9.
8.
Give
an actual (not synthetic) instruction to set the Z flag if a register X has all
bits set to 1’s
9.
Suppose two 32 bit Boolean arrays a and
b are stored in %l0 and %l1 respectively.
A. Write instructions to compute a nor b, leaving the answer in %l3.
B. Write the mask to determine if any of the bits 0, 3, 4, 8, 11, 16, 22,
and 25 of register %l3 are set.
C. Write the instruction to test those bits.
10.
An
outdoor sprinkler system turns on at 7 PM every day, but only if it isn’t
raining. Model the system that turns on the sprinklers using SPARC
instructions, as we did in class. A sensor for the timer is 1 if the sprinklers
should be on, and a sensor for the presence of rain is 1 if it is raining.