32 bits binary number

Source: Internet
Author: User

A positive integer less than 2^32 is given. This number can be represented by a 32-bit binary number (less than 32 bits with 0 complement). We call the first 16 bits of the binary number "high" and the last 16 bits "low." We can get a new number by exchanging its high and low positions. How much this new number is (in decimal notation).
For example, the number 1314520 is represented by a binary representation of 0000 0000 0001 0100 0000 1110 1101 1000 (added 11 leading 0 topping for 32 bits), where the first 16 bits are high, i.e. 0000 0000 0001 0100; the latter 16 bits are low, i.e. 0000 1 110 1101 1000. Swapping its high and low positions, we got a new binary number 0000 1110 1101 1000 0000 0000 0001 0100. It is the decimal 249036820.

Assuming this is an int (4 byte, 32 bit) type, then:

1 The original code: 00000000 00000000 00000000 00000001

32 bits binary number

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.