KT14203- Computer Architecture and Organization
Sekolah Kejuruteraan dan Teknologi Maklumat
                                        QUIZ #4
   1. Represent the following decimal numbers in both binary sign/magnitude and
      twos complement using 16 bits: +512; -29                     [4 marks]
   Answer:
       Sign Magnitude:        512   = 0000   0010 0000 0000      [1 mark]
                             29    = 1000   0000 0001 1101      [1 mark]
       Twos Complement:       512   = 0000   0010 0000 0000      [1 mark]
                             29    = 1111   1111 1110 0011      [1 mark]
   2. Given x = 23 and y = 29. Compute the product X x Y with Booths
      Algorithm using 6-bit words.                      [12 marks]
       Answer:
For table, each row [1 mark]. Total = 11 marks
   A                   Q                       Q-1        M
                       (multiplier)                       (multiplicand)
   000000              011101                  0          010111     [1]
   101001              011101                  0          A <- A-M   [1]
   110100              101110                  1          Shift      [1]
   001011              101110                  1          A <- A+M [1]
   000101              110111                  0          SHIFT       [1]
   101110              110111                  0          A <- A-M   [1]
   110111              011011                  1          SHIFT       [1]
   111011              101101                  1          SHIFT       [1]
   111101              110110                  1          SHIFT       [1]
   010100              110110                  1          A <- A+M [1]
   001010              011011                  0          SHIFT      [1]
A = 001010 , Q = 011011
001010 011011 = 667                   [1]
Semester 2 2013/2014                                                          Page 1