Java Primitive Data Types -Floating Point

Java Primitive Data Types -Floating Point

<p> KEY Java Primitive Data Types -Floats IEEE (Institute of Electronics and Electrical Engineers) Standard 754</p><p>1. Convert the following base 10 decimals to binary. a) 0.1 = 0.0001 1001 1001 1001 1001 1001 1001 1001 b) 0.2 = 0.0011 0011 0011 0011 0011 0011 0011 0011 c) -0.25 = -0.01 d) -0.5 = -0.1 e) 8.125 = 1000.001</p><p>2. Convert the binary numbers in 1. to 1-plus normalized base 2 representation with exponent E +E written in excess-127 format: N =  (1.b1b2b3 …b23 )2 x 2 (Round b23 based on b24.) a) 1.1001 1001 1001 1001 1001 101 x 100111 1011 b) 1.1001 1001 1001 1001 1001 101 x 100111 1100 c) -1.0000 0000 0000 0000 0000 000 x 100111 1101 d) -1.0000 0000 0000 0000 0000 000 x 100111 1110 e) 1.0000 0100 0000 0000 0000 000 x 101000 0010</p><p>The Java primitive data type float is 4 bytes, or 32 bits: 1 bit Sign 8 bit exponent 23 bit mantissa</p><p>3. Write your 1-plus normalized base 2 representation with excess-127 exponent as a java float (rounded) and as an 8-digit hexadecimal. a) 0011 1101 1100 1100 1100 1100 1100 1101 3DCCCCCD b) 0011 1110 0100 1100 1100 1100 1100 1101 3E4CCCCD c) 1011 1110 1000 0000 0000 0000 0000 0000 BE800000 d) 1011 1111 0000 0000 0000 0000 0000 0000 BF000000 e) 0100 0001 0000 0010 0000 0000 0000 0000 41020000</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us