In-depth understanding of computer system second exercise answers CSAPP 2.6, csapp2.6

Source: Internet
Author: User

In-depth understanding of computer system second exercise answers CSAPP 2.6, csapp2.6

By Printing bytes, we can know that the hexadecimal value of decimal number 12345 is 0x00003039, And the hexadecimal value of decimal floating point number 12345.0 is 0x4640E400.

Convert to binary

1 /*2        0   0   0   0   3   0   3   93     000000000000000000110000001110014                        *************5                  4   6   4   0   E   4   0   06               010001100100000011100100000000007 8 */

There are 13 matches after moving.

The hexadecimal value of decimal number 3510593 is 0x00359141, And the hexadecimal value of decimal floating point number 3510593.0 is 0x4a562134.

A. Write the binary representation of the above two numbers.

B. Move the relative positions of the two binary strings so that they match the most BITs. How many bits are matched?

C. The position in the string does not match.

 

1 /*2        0   0   3   5   9   1   4   13     000000000011010110010001010000014                *********************5          4   A   5   6   4   5   0   46       010010100101011001000101000001007 8 */

A.

1 /*2 0x003591413 0000 0000 0011 0101 1001 0001 0100 00014 5 0x4A5645046 0100 1010 0101 0110 0100 0101 0000 01007 */

B .21 match

C. intuitively: the first 9 and last 2 digits do not match the floating point number.

For integer numbers, the positions from the high to the 1st-bit non-0 do not match.

 

We will learn more about floating point storage later.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.