13.07.2015 Views

The Midterm Solution - Suraj @ LUMS - Lahore University of ...

The Midterm Solution - Suraj @ LUMS - Lahore University of ...

The Midterm Solution - Suraj @ LUMS - Lahore University of ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

24. [15 marks]a) Convert the binary number 1001011.101 to decimal [2]1001011.101 = 1×2−3+ 1×2+ 1×2+ 1×2+ 1×2= 0.125 + 0.5 + 1 + 2 + 8 + 64= 75.625b) Convert the hexadecimal number AC to decimal: [1]−1013+ 1×26AC = 12 × 16= 1720+ 10 × 161What are the smallest and largest numbers that you can represent in a 10-bit register using:c) Unsigned notation [2]smallest number = 0largest number = 210−1= 1024 −1=1023d) Two’s complement notation (using the left-most bit as the sign-bit) [2]9smallest number = - 29largest number = + 2= −512−1= + 511e) Consider the following data definitions in a program: [2].datalist WORD 13, 11o, 42h, 00101011bFill out the corresponding values in HEX in the following table. <strong>The</strong> <strong>of</strong>fsets arefrom the data segment.OffsetValue0000 00 h0001 0D hPage 12 <strong>of</strong> 16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!