**************** Problem 1 and 2 shortcut With "12-bit fixed-point twos-complement representation with 6 integer bits and 6 fraction bits" the easiest approach is to pretend it's a 12-bit twos-complement number that you divide (or multiply) by 2^6 (or 64) **** Problem 1 -25.25 Since it's negative, should be expressed as -25.25 = -32 + 6.75 6.75 is 4 + 2 + 1/2 + 1/4 or 00110.1100000 Answer is 100110.110000, that is -32 + 4 + 2 + 1/2 + 1/4 8.8 is 8.8 interative doubling of fraction gives .8 1 .6 1 .2 0 .4 0 .8 1 .6 1 .2 0 .4 first six give .110011 or 1/2 + 1/4 + 1/32 + 1/64 or 51/64 0.8 * 64 is 51.2/64 and 51 is closest integer to 64 001000.110011 Alternative approach * by 64 -25.25 * 64 = -1616 -- translate -1616 to 12-bit twos complement 8.8 * 64 = 563.2 -- translate 563 to 12-bit twos complement **** Problem 2 111000111000 is -32 + 16 + 8 + 1/2 + 1/4 + 1/8 or -8 + 7/8 or -7.125 000011000000 is 2 + 1 or 3 Alternative approach / by 64 111000111000 is -456 in 12-bit twos complement, -456/64 is -7.125 000011000000 is 192 in 12-bit twos complement, 192/64 is 3 **************** Problems 3 and 4 short cut. Use http://www.cs.unca.edu/brock/classes/Spring2017/csci255/index.shtml **** Problem 3 42.75 is 32 + 8 + 2 + 1/2 + 1/4 or 101000.11 in binary 101010.11 is 1.0101011 * 2^5 For IEEE 754 1-bit sign field is 0 (positive) 8-bit exponent field is 132 (exceess 127 gives 127+5) or 10000100 23-bit fraction is 01010110000000000000000 32-bit representation is 01000010001010110000000000000000 or 0x422B0000 **** Problem 4 0x369C0000 is 0011 0110 1001 1100 0000 0000 0000 0000 or 00110110100111000000000000000000 or 0 01101101 00111000000000000000000 1-bit sign field is 0 (positive) 8-bit exponent field is 01101101 or 64+32+8+4+1 or 109 subtracting 127 for 109 yields -18 multipler is 2^-18 or 1/262144 23-bit fraction is 00111000000000000000000 or 1/8 + 1/16 + 1/32 or (4+2+1)/32 or 7/32 or 39/32 when you add in the leading 1 according to my calculator (1/262144)*(39/32) = 39/8388608 or .00000464916229248046875