SOLUTION TO QUIZ #2:
--------------------

1. 6 rows and 9 columns: X shows element [4,8]

  (a)

	 0   1   2   3   4   5  6   7   8
        -----------------------------------
   0   |   |   |   |   |   |   |   |   |   |
        -----------------------------------
   1   |   |   |   |   |   |   |   |   |   |
        -----------------------------------
   2   |   |   |   |   |   |   |   |   |   |
        -----------------------------------
   3   |   |   |   |   |   |   |   |   |   |
        -----------------------------------
   4   |   |   |   |   |   |   |   |   | X |
        -----------------------------------
   5   |   |   |   |   |   |   |   |   |   |
        -----------------------------------

	Column-major order => to get to element [4,8], we have to go thru
	52 other elements (first go column-wise, then row-wise).

	=> Since each element is 4 bytes, it means 52*4 = 208 bytes total

	=> Base address of array = 1024 - 208 = 816


  (b) Now, array in row-major order
      => Address of element [4,8] = base address + ( (num_columns*4) + 8) * 4
				  = 816 + ( (9*4) + 8) * 4
				  = 816 + 176
				  = 992


2. 

  lw $8, 4($9)			=> $8  = 0000 1010

  lw $7, 0($8)			=> $7  = 5678 9abc

  lb $10, -4($9)		=> $10 = 0000 0034
	Note that this is load BYTE instruction. Since we are given
	Little-Endian byte addressing, it will load the least significant
	byte in memory location 0x0ffc to the least significant byte of
	register $10.
	Luckily for us, since 34 has its most significant bit as 0, which is
	positive, no sign extension is done. The LB instruction sign-extends
	the higher 24 bits of register with the MSB of the byte loaded.

  sub $10, $7, $10		=> $10 = 5678 9abc - 0000 0034
				       = 5678 9a88

  sw $10, 16($9)		=> memory 0x1010 = 5678 9a88



  (a) $7	= 5678 9abc

  (b) $8	= 0000 1010

  (c) $9	= 0000 1000

  (d) $10	= 5678 9a88

  (e) M[1010]	= 5678 9a88