[Switch] 32-bit and 64-bit system differences and INT bytes

Source: Internet
Author: User

Http://blog.csdn.net/zhongzhiwei/article/details/8678885

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

1. 64-bit CPU has greater addressing capability and supports up to 16 GB memory, while 32-bit only supports 4 GB memory

2. 64-bit CPU can extract 64-bit data at a time, which is twice higher than 32-bit. Theoretically, the performance will be doubled. However, this is based on the 64-bit operating system and 64-bit software.

 

What is a 64-bit processor?

It is called a "64-bit processor" because the computer implements binary computation, and the processor (CPU) can process data at a time in multiples of 2. 8-bit processor, 16-bit processor, 32-bit processor and 64-bit processor, the count is a multiple of 2. The larger the data processed at a time, the larger the computer's ability to process information. Therefore, 64-bit processing is inherently faster than 32-bit processors. So why not use a more advanced 128-bit processor? The higher the number of digits, the more complicated the design of the processor chip. Currently, the technology level cannot manufacture such a complicated chip.

 

64-bit processor loss

※Hardware --- many existing hardware cannot be used due to lack of drivers

※Software-the operating system is not a problem, but the software is incompatible.

 

64-bit Processor

※Hardware --- faster execution speed and greater Memory Management

※Software --- the latest cutting-edge software first appears on the 64-bit Platform

 

(2) number of bytes corresponding to the Data Type

Program running platform
The number of bytes allocated for different data types varies on different platforms.
My personal understanding of the platform is CPU + OS + compiler, because:
1. 64-bit machines can also be installed with 32-bit systems (XP for x64 );
2. A 32-bit machine can have a 16/32-bit Compiler (on XP, TC is 16-bit, and other common ones are 32-bit );
3. Even a 32-bit compiler can generate 64-bit integers (int64 ).
These are based on the common Wintel platform, and other platforms (other CPU and OS) that we may rarely have access to. Therefore, I personally think that the concept of the platform is a combination of the three.
Although the length of the three can be different, it is clear that they work together (that is, the length is equal, 32-bit CPU + 32-bit OS + 32-bit compiler) to maximize the energy.
Theoretically, I think the number of bytes of the data type should be determined by the CPU, but it is mainly determined by the compiler (the number of bytes is determined by the compiler during compilation ).

Number of bytes corresponding to Common Data Types
It can be obtained by sizeof (char) or sizeof (char *).

32-bit Compiler:

CHAR: 1 byte
Char * (pointer variable): 4 bytes (32-bit addressing space is 2 ^ 32, that is, 32 bits, that is, 4 bytes. Similarly, 64-bit compiler)
Short INT: 2 bytes
INT: 4 bytes
Unsigned INT: 4 bytes
Float: 4 bytes
Double: 8 bytes
Long: 4 bytes
Long long: 8 bytes
Unsigned long: 4 bytes

64-bit Compiler:

CHAR: 1 byte
Char * (pointer variable): 8 bytes
Short INT: 2 bytes
INT: 4 bytes
Unsigned INT: 4 bytes
Float: 4 bytes
Double: 8 bytes
Long: 8 bytes
Long long: 8 bytes
Unsigned long: 8 bytes

[Switch] 32-bit 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.