Docsity

Solutions to Homework 6 in ECE2030: Binary and Hexadecimal Number Representations - Prof. , Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE2030 A,B: Dr. Schimmel: Homework 6 - SOLUTIONS
1. 11011 = 16+8+2+1 = 27
2. 11.1 = 2+1+ ½ = 3.5 (places to the right of the decimal point have the values 1/21, 1/22, 1/23,
1/24… or 0.5, 0.25, 0.125, 0.0625, KNOW THESE!)
3. 1010.011 = 8+2+0.25+0.125 = 10.375
4. 61 = 0111101 (the leading 0 is NECESSARY to signify a positive number, 111101 as a
signed magnitude number is -29)
5. -100 = 11100100
6. 0x05EF = 0000010111101111 (each hex # is 4 bits, so write down each digit as a 4 bit binary
number)
7. 0xEF = 239 (0xEF are the least significant 8 bits)
8. 0xABDC = 1010101111011100
9. 0xAB = 171
10. 111111 is the smallest 6 bit signed magnitude number = -31 (you should KNOW the smallest
and largest values of k-bit unsigned, signed magnitude, and 2’s complement numbers)
11. 011111 is the largest 6 bit signed magnitude number = 31 (you should KNOW the smallest
and largest values of k-bit unsigned, signed magnitude, and 2’s complement numbers)
12. -143 = 101110001 (to get 2’s complement, take positive 143 and convert it to binary:
10001111, invert all values: 01110000, add 1 to get 101110001).
13. -76 = 10110100
14. True. You can only get overflow when you add two positive or two negative 2’s
complement numbers, but not when you add a negative and a positive. Verify this with the
9/28/09 4-bit circle example, also see 9/30/09 notes or the book on overflow.
15. False, see #14 for explanation.
16. True, see #14 for explanation.
pf3

Partial preview of the text

Download Solutions to Homework 6 in ECE2030: Binary and Hexadecimal Number Representations - Prof. and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

ECE2030 A,B: Dr. Schimmel: Homework 6 - SOLUTIONS

  1. 11011 = 16+8+2+1 = 27
  2. 11.1 = 2+1+ ½ = 3.5 (places to the right of the decimal point have the values 1/2^1 , 1/2^2 , 1/2^3 , 1/2^4 … or 0.5, 0.25, 0.125, 0.0625, KNOW THESE!)
  3. 1010.011 = 8+2+0.25+0.125 = 10.
  4. 61 = 0111101 (the leading 0 is NECESSARY to signify a positive number, 111101 as a signed magnitude number is - 29)
    • 100 = 11100100
  5. 0x05EF = 0000010111101111 (each hex # is 4 bits, so write down each digit as a 4 bit binary number)
  6. 0xEF = 239 (0xEF are the least significant 8 bits)
  7. 0xABDC = 1010101111011100
  8. 0xAB = 171
  9. 111111 is the smallest 6 bit signed magnitude number = - 31 (you should KNOW the smallest and largest values of k-bit unsigned, signed magnitude, and 2’s complement numbers)
  10. 011111 is the largest 6 bit signed magnitude number = 31 (you should KNOW the smallest and largest values of k-bit unsigned, signed magnitude, and 2’s complement numbers)
    • 143 = 101110001 (to get 2’s complement, take positive 143 and convert it to binary: 10001111, invert all values: 01110000, add 1 to get 101110001).
    • 76 = 10110100
  11. True. You can only get overflow when you add two positive or two negative 2’s complement numbers, but not when you add a negative and a positive. Verify this with the 9/28/09 4-bit circle example, also see 9/30/09 notes or the book on overflow.
  12. False , see # 1 4 for explanation.
  13. True , see #14 for explanation.
  1. 1110 + 1010 = 1000. It doesn’t matter what kind of numbers these are, the bit pattern will never change when you add them. The kind of numbers will only determine whether the result is valid or not.
  2. No , 13+10=23, 23 cannot be represented in 4 bit unsigned binary
  3. 1000 , See #
  4. Yes , - 2+-6=-8, no overflow occurs
  5. 1001 + 0011 = 1100
  6. Yes , 9+3 = 12. 12 is represented by 1100 in 4 bit unsigned binary.
  7. 1100 , see 17 for explanation
  8. Yes , 1001 = - 7, 0011 = 3, - 7+3 = - 4. - 4 is represented by 1100 in 2’s complement.
  9. 10100001 + 01011011 = 01000110
  10. No , 161 - 91=70. All of these numbers can be represented by a 8-bit unsigned binary number.
  11. 01000110 , again bit pattern does not change depending on what kind of numbers they are.
  12. Yes , - 95 - 91=-186, - 186 is not representable in 8-bit 2's complement numbers. Smallest number for an 8-bit 2's complement number is - 128. Therefore, overflow has occurred.
  13. 125. 0xFE5C4000 = 1111 1110 0101 1100 0100 0000 0000 0000 in binary. The spaces are for readability. Per pg. 525 in your book, MSB is the sign bit. The next 8 bits are 11111100, which is 252. Since the exponent field is a +127 bias, 252-127 = 125 is the actual exponent.
  14. 9. 0x41100000 converted to binary is: 0100 0001 0001 0000 0000 0000 0000 0000. The MSB is the sign bit, so the answer is positive. The next 8 bits (1000 0010) reveal a 130 biased exponent. So the actual exponent is 130-127=3. The next few bits are concatenated with the implied 1 giving us 1.001. Shifting the decimal point right 3 places gives us 1001. Convert this to decimal and you have 9.
  15. The sign bit is 1, since it is negative. Then convert 127.3125 to 1111111.0101, then shift the decimal left six places. This yields 1.1111110101 x 2^6 so the exponent field is 6+127=