In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
C language programmer entry basic knowledge is what, many novices are not very clear about this, in order to help you solve this problem, the following small series will be explained in detail for everyone, there are people who need this to learn, I hope you can gain something.
C language is one of the most widely used languages in all current development technologies, and it has been loved by programmers since its birth. With the popularity of C, later development languages have more or less borrowed or followed some of its patterns. In addition, C language is one of the earliest high-level languages used in the field of computer programming, and its emergence has promoted the rapid development of the software industry. This chapter will briefly introduce the basic knowledge of the C language, laying the foundation for readers to learn the following content.
1.1 computer application Foundation
A computer is a highly automated electronic device that can receive and store information, process and process input information according to internal stored programs, and then output the processing results. This section introduces the basic knowledge of computer applications, laying the foundation for readers to learn the knowledge behind.
1.1.1 central processor
CPU is what we usually call CPU (Central Processing Unit), which is a super-large-scale integrated circuit and the computing core and control core of the computer. It mainly includes Arithmetic and Logic Unit (ALU) and Control Unit (CU). In addition, it includes several registers and memories and data, control and status buses between them. Together with internal memory and input/output devices, it is collectively referred to as the three core components of an electronic computer. Its main function is to interpret computer instructions and process data in computer software. The performance of a computer is largely determined by the performance of the CPU, which is primarily reflected in the speed at which programs run.
1.1.2 bits and bytes
1. bit
Bit is also called bit, and bit is an abbreviation for BinarySystem. In real life, bits have two meanings.
(1) It is a computer term and a unit of information. A binary number contains one bit of information, such as the binary number 0100 has four bits. In computer applications, the binary numbers "0" and "1" are the smallest units of information, called "bits" or "bits."
(2) The bits in binary digits are the units of measurement for the amount of information, and are the smallest units of information. Digital sound expresses audio signals with electrical pulses, with "1" representing pulses and "0" representing pulse intervals. If the information at each point in the waveform is represented by a code of 4 bits, then each code has 4 bits. The more bits, the more accurate the analog signal is expressed, and the stronger the ability to restore audio signals.
2. Byte
Byte is a unit of storage capacity used in computer information technology, sometimes representing data types and language characters in some computer programming languages.
In computer applications, a byte consists of several bits. How many bits a byte consists of depends on the architecture of the computer. Generally speaking, the CPU of a microcomputer consists of 8 bits and 1 byte, and this is used to represent the code of a character. The eight bits that make up a byte are considered as a whole, and the byte is the basic unit of stored information. In most cases, computer storage units are converted as follows:
1B=8bit1KB=1024B1MB=1024KB1GB=1024MB
A detailed description of each unit in the above relationship is as follows:
B: Represents bytes.
bit: indicates bit.
KB: represents kilobytes.
MB: Megabytes.
GB: stands for gigabyte.
1.1.3 binary
Binary is a number system widely used in computer technology, which uses two numbers, 0 and 1, to represent numbers. Binary radix is 2, carry rule is "every two into one," borrow rule is "borrow one when two," this is by the 18th century German mathematical philosophy master Leibniz discovered. The current computer systems are basically binary system, data in the computer is mainly stored in the form of complement. Binary in computers is a tiny switch, with "on" for 1 and "off" for 0. Because it uses only two digital symbols, 0 and 1, it is very simple and easy to implement electronically.
Here is how to convert decimal numbers to binary numbers.
(1) Convert positive integers to binary.
The principle of conversion is to divide by 2 to get the remainder, and then reverse the order, high zero complement. That is to say, divide the positive decimal number by 2, divide the quotient by 2, and so on until the quotient is 0 or 1, then mark the remainder of each step next to it, and finally write it backwards, filling in zeros at the high places. For example, to convert the decimal number 42 to binary, divide 42 by 2 to get 010101, and then reverse the remainder to get 42, which corresponds to 101010. However, because the byte units used to represent numbers inside the computer are fixed-length (e.g., 8, 16, or 32 bits), zeros need to be added to the upper bits when the number of bits is insufficient. The decimal number 42 converted to binary results in 101010, which is missing two digits in front of it, so the final result of converting the decimal number 42 to binary is: 00101010.
(2) Convert negative integers to binary.
The conversion principle is to first convert the corresponding positive integer to binary, and finally to reverse the binary number, and finally to add 1 to the result. For example, taking the decimal negative integer −42, inverting the binary form of 42 (00101010) yields 11010101, and adding 1 yields 11010110. So the final result of converting the negative integer −42 to binary is: 11010110.
(3) Convert binary integers to decimal.
The principle of conversion is to fill the binary digits first. If the first digit is 0, it is a positive integer; if the first digit is 1, it is a negative integer. First look at the positive integer whose first digit is 0, and after filling in the number of digits, we get the calculation result of n× 2m. where superscript m represents the number of digits in binary and n represents a binary digit. Calculate n× 2m for each bit of binary number, and then add the results to obtain a decimal number.
Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.