Information is bit + context read for a deep understanding of computer systems

Source: Internet
Author: User

 

Our helloProgramIs from a source program (or source file). The source program is created and saved as a text file by the programmer through the editor. The file name is helloc. C. The source program is actually a bit sequence consisting of 0 and 1. These bits are organized into eight groups called bytes. Each byte represents a text character in the program.

Most modern systems use the ASC standard to Represent Text characters. In this way, each character is actually represented by a unique integer of the byte size. The ASC code representation of the hello. C program is provided.

Hello. C Programs are stored in files in byte sequences. Each byte has an integer corresponding to a character. For example, the integer of the first byte is 35, which corresponds to the character "#". The second integer is 105, and the corresponding character is "I", and so on. Note that each line of text ends with an invisible linefeed "\ n", and its corresponding integer is 10. Files like hello. C consisting of ASC characters are called text files, and all other files are called binary files.

Hello. the C representation method illustrates a basic idea: all the information in the system, including disk files, programs in the memory, user data stored in the memory, and data transmitted over the network, it is represented by a string of bits. The only way to differentiate different data objects is the context when we read these data objects. For example, in different contexts, the same byte sequence may represent an integer, floating point number, string, or its instructions.

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.