32-and 64-bit system differences and int bytes

Source: Internet
Author: User

A) What is the difference between a 64-bit system and 32-bit?

1, 64bit CPU has greater addressing capacity, the maximum support to 16GB memory, and 32bit only support 4G memory

The 2, 64-bit CPU can extract 64 bits of data at a time, which is twice as high as 32 bits, and the theoretical performance will be increased 1 time times. But this is built on the basis of 64bit operating system, 64bit software.

What is a 64-bit processor?

It is called a "64-bit processor" because the internal computer is the implementation of 2 binary operations, the processor (CPU) processing data at a time is a multiple of 2. 8-bit processors, 16-bit processors, 32-bit processors, and 64-bit processors are counted in multiples of 2. The larger the data processed at one time, the greater the ability of the computer to process information, so that 64-bit processing is inherently faster than a 32-bit processor. So why not use a more advanced 128-bit processor? Because the higher the number of bits, the more complex the design of the processor chip, the current level of technology can not create such a complex chip.

Loss of 64-bit processor

※ Hardware ——— Lack of drivers, many existing hardware can not be used

※ Software ——— operating system is not an issue, but the software is not compatible with the problem

64-bit processor

※ Hardware ——— faster execution speed, greater memory management

※ Software ——— The latest cutting-edge software first appeared on 64-bit platform

(ii) Number of bytes in the data type

Program Run Platform
The number of bytes allocated on different platforms is different for different data types.
The personal understanding of the platform is cpu+os+compiler because:
1, 64-bit machine can also be installed 32-bit system (x64 installed XP);
2, 32-bit machine can have 16/32-bit compiler (XP on the TC is 16-bit, other common 32-bit);
3. Even a 32-bit compiler can make a 64-bit integer (Int64).
These are based on the common Wintel platform, plus other platforms (other CPUs and OS) that we may have little chance of contacting, so the concept of the so-called platform is a combination of the three.
Although the lengths of the three can be different, it is obvious that the energy is maximized by the interplay (i.e., the compiler of the cpu+32 bits of the same length, the 32-bit os+32 bit).
In theory, I think the number of bytes in the data type should be determined by the CPU, but it's essentially the compiler's decision (how many bits are made by the compiler during compilation).

Common data types correspond to byte numbers
Available such as sizeof (char), sizeof (char*), etc.

32-bit compilers:

Char:1 bytes
char*(i.e. pointer variable ): 4 bytes (32-bit addressing space is 2^32, which is 32 bit, or 4 bytes. Similarly 64-bit compilers)
Short Int:2 bytes
Int:4 bytes
Unsigned int:4 bytes
Float:4 bytes
Double:8 bytes
A long: 4 bytes
A long long:8 bytes
unsigned long: 4 bytes

64-bit compilers:

Char:1 bytes
char* (i.e. pointer variable): 8 bytes
Short Int:2 bytes
Int:4 bytes
Unsigned int:4 bytes
Float:4 bytes
Double:8 bytes
A long: 8 bytes
A long long:8 bytes
unsigned long: 8 bytes

32-and 64-bit system differences and int bytes

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.