Data is always stored in binary format in the memory. The value is indicated by a complement.

Source: Internet
Author: User

The basic types include-integer, real, and enumeration type!

Data is always stored in binary format in the memory. The value is indicated by a complement.

Integer:
A positive complement is the same as its original code. The Complement Method of a negative number is to add 1 to the binary form of its absolute value"

Real Type:
Memory occupies 4 bytes and is stored in exponential form. Real data is divided into fractional and exponential parts, respectively! The computer uses binary to represent the fractional part, and the power of 2 to represent the exponential part!

Character Type:
In memory, character storage actually refers to the ASCII corresponding to characters.CodeStored in a storage unit. These ASCII code values are also stored in binary form in the computer. This is similar to integer storage. Therefore, the conversion between these two classes is also convenient!

The following is from another one (Chenchao note)

Iii. Storage Format and usage of character data in memory
When the system expresses a character type data, it does not store the character shape into the memory, but only saves the ASCII code of the character into the memory. All the data in the memory is stored in binary format. In the above example, 'x' and 'y' are represented in the memory as follows:
The ASCII codes of 'X' and 'y' are 120 and 121. The binary formats of 120 and 121 are 1111000 and 1111001.
Therefore, the memory values of 'A' and 'B' are 1111000 and 1111001.

 

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.