Run the programs by
setting the value of the PC to 0x400000 and
then single stepping (pushing F10)
or by multiple stepping (push F11 and enter a number of steps).
Observing the results in the SPIM window.

*Exercise 2 — Significant Bits

With an ori instruction,
initialize $8 to a bit pattern
that represents a positive integer.
Now the program determines how many
significant bits are in the pattern.
The significant bits are
the leftmost one bit and all bits to its right.
So the bit pattern:

0000 0000 0010 1001 1000 1101 0111 1101

... has 22 significant bits.
(To load register $8 with the above pattern,
0x00298D7D, use
an ori followed by a left shift followed
by another ori.)

**Exercise 3 — Allowed Ranges

A temperature in $8 is allowed
to be within either of two ranges:
20 <= temp <= 40
and
60 <= temp <= 80.
Write a program that sets a flag (register $3) to 1
if the temperature is
in an allowed range and
to 0 if the temperature is not in an allowed range.

****Exercise 4 — Median of Three

Write a program that computes the median of three values
in memory.
After it has been found,
store the median in memory.

.data
A: .word 23
B: .word 98
C: .word 17

The median of three integers is greater than or equal to one integer
and less than or equal to the other.
With the above three integers the median is "23".
Assume that the data changes from run to run.
Here is some more possible data: