What Is a Negative Carry?

The carry state includes a computer system including a hardware system and a software system, which are executed by executing a program.

Carry state

Right!
The carry state includes a computer system including a hardware system and a software system, which are executed by executing a program.
Chinese name
Carry state
computer system
Hardware system and software system
How it works
Run by executing the program
Base number
Binary
Computer working principle
Computer System Overview
The computer system consists of two parts: hardware system and software system. Computers run by executing programs. Software and hardware work together when the computer is working. Both are indispensable. Hardware is the physical device that makes up a computer. It is some tangible physical entity that can be seen and touched. A computer hardware system includes five functional components from a functional level perspective: arithmetic unit, controller, memory, input device and output device. Hardware is the material foundation on which a computer can operate. The performance of a computer, such as computing speed, storage capacity, calculation accuracy, and reliability, depends largely on the hardware configuration. A computer with only hardware and no software support is called bare metal. Only machine language programs can be run on bare metal, which is very inconvenient and inefficient. Software (Software) refers to the programs, data, and related technical documentation needed to make a computer run. Software is the soul of a computer and the key to its function. With software, people don't have to know too much about the structure and principle of the machine itself, and can use the computer conveniently and flexibly. The software shields the underlying specific computer hardware to form an abstract logical computer (also called a virtual machine), which bridges the gap between the user and the computer (hardware). Software is usually divided into two categories: system software and application software. System software is software provided by computer manufacturers to use and manage computers. It includes operating systems, language processing systems, and common service programs. Application software is software developed by computer users to solve various practical problems using computers and various system software provided by them.
First, the main points of knowledge required (1) Master the decimal number, binary number, hexadecimal number, octal number and the method of conversion between them. (2) Grasp the rules of arithmetic and logical operations of binary numbers, and the representation of data in computers. (3) Master the concepts of BCD code, ASCII code and Chinese character coding. (4) Familiar with the composition of the central processing unit CPU and the functions of the main internal components. 2. Overview of Knowledge Points (1) Representation of data in a computer The main function of a computer is to process information, such as processing numerical values, text, sound, graphics, and images. In a computer, all kinds of information must be digitally encoded before they can be transmitted, stored, and processed. Therefore, it is important to master the concept and processing technology of information encoding. The so-called coding is to use a small number of basic symbols and select a certain combination principle to represent a large amount of complex and diverse information. The types of basic symbols and the rules for combining these symbols are the two major elements of all information coding. For example, 10 Arabic numerals are used to represent numbers, and 26 English letters are used to represent English words. These are typical examples of coding. 1. Carry Count System In a digital system that uses carry count, if only r basic symbols (for example, O, 1,2, ..., r-1) are used to represent a value, it is called Radix-rNumberSystem , R is called the base of this number system (Radix). For different number systems, their common characteristics are: · Each number system has a fixed symbol set. For example, for the decimal number system, there are 10 signs: 0, 1, 2, ..., 9; for the binary number system, there are two signs: O and 1. · Both use position notation. That is, the numbers in different positions represent different values, and are related to the weight of its position. For example, the decimal number 1234.55 can be expressed as 1234.55 = 1 × 103 + 2 × 102 + 3 × 101 + 4 × 100 + 5 × 10-1 + 5 × 10-2. It can be seen that the weights in various round counting systems The value happens to be some power of the base. Therefore, any number represented by the round counting system can be written as the sum of the polynomials that are expanded according to weight, that is, any arbitrary r-number N can be expressed in the formula: Di is the basic number symbol used by the number system; ri is Weight; r is the base, and different bases represent different base numbers. Table 1-1 shows several base numbers commonly used in computers. Table 1-1 Representation of several base numbers commonly used in computers. Binary octal decimal hexadecimal rules. Binary, octal, octal, octal, octal, and hexadecimal. = 16 The numbers O, 1O, 1,2, ..., 7O, 1,2, ..., 9O, l, 2, ..., 9, A, B, ..., F weights 2i8i10i16i form BODH2. Arithmetic logic operation (1) Binary addition. Binary addition is similar to decimal addition, the difference is that the rule of binary addition is "every two into one", that is, O + 0 = 01 + 0 = 10 + 1 = 11 + 1 = 0 (with carry) (2) Binary subtraction. In binary subtraction, borrowing is needed when there is not enough subtraction. The high-order 1 is equal to the next-most 2, that is, "borrow one to two". The algorithm is as follows: 0-0 = 01-0 = 11-1 = 00- 1 = 1 (with borrow) (3) Binary multiplication. Binary multiplication is the same as decimal multiplication, but because binary numbers are only composed of 0 and 1, binary multiplication is simpler. The algorithm is as follows: O × O = O1 × O = 0O × 1 = 01 × 1 = 1 ( 4) Binary division. Binary division is the inverse operation of binary multiplication, and its operation method is the same as that of decimal division. (5) Binary AND operation is also called logical multiplication, and its algorithm is as follows: O0 = OO1 = 01O = 011 = 1 (6) Binary OR is also called logical addition, and its algorithm is as follows: 0 O = 001 = 110 = 111 = 1 (7) The algorithm of binary XOR is as follows: OO = 001 = 110 = 111 = 03. The form of machine number and code system in the computer is called machine number. Its characteristic is that the sign of the number is represented by O and 1. For example, "0" means positive sign, "1" means negative sign, and the decimal point is implied. Indicates without occupying a position. The actual value corresponding to the number of machines is called the true value of the number. There are two types of machine numbers: unsigned and signed. Unsigned numbers represent positive numbers, and there are no sign bits in machine numbers. For unsigned numbers, if the position of the decimal point is after the lowest digit of the machine number, it is a pure integer; if the position of the decimal point is before the highest digit of the machine number, it is a pure decimal. For signed numbers, the most significant bit of the machine number is the sign bit that represents positive and negative, and the remaining binary bits represent the value. If the position of the agreed decimal point is after the lowest numerical digit of the machine number, it is a pure integer; if the position of the agreed decimal point is before the highest numerical digit of the machine number (after the sign bit), it is a pure decimal. In order to facilitate the calculation, the signed machine numbers can adopt different coding methods such as original code, inverse code and complement code. These coding methods of machine numbers are called code systems. 4 Chinese character coding Chinese character processing includes coding input of Chinese characters, storage of Chinese characters, and output of Chinese characters. In other words, to process Chinese characters, the computer must first encode the Chinese characters, that is, encode the Chinese characters. 1) Enter the code
(1) Digital coding. Digital coding is to use a digital string to represent the input of a Chinese character. Commonly used is the national standard area code. The international location code divides the 6,763 two-level Chinese characters published by the National Bureau of Standards into 94 districts, each with 94 digits. In fact, the Chinese characters are represented as a two-dimensional array. The location and the code are two decimal digits each. Therefore, enter one Chinese characters need to be pressed four times. For example, the word is located at 48 digits in the 54th area, and the location code is 5448: (2) Pinyin code. Pinyin code is an input method based on Chinese pronunciation. Because there are too many homophones in Chinese characters, the input recoding rate is very high. Therefore, you must also select homophones after inputting according to Pinyin, which affects the input speed. (3) Glyph coding. Glyph coding is a coding determined by the shape of a Chinese character. Although the total number of Chinese characters is large, they are composed of one stroke and one stroke. All Chinese character parts and strokes are limited. Therefore, if you encode the stroke parts of Chinese characters with letters or numbers and enter them in the order of stroke writing, you can display them. A Chinese character. Wubi glyphs and table-shaped codes are such coding methods. Wubi glyph coding is the most influential coding method. 2) Internal code
Chinese character internal code (abbreviated as Chinese character internal code) is the most basic form of expression of Chinese characters in equipment or information processing systems. It is a code for storing, processing, and transmitting Chinese characters in equipment and information processing systems. In Western languages, there is no distinction between exchange and internal codes. There are many Chinese characters. It cannot be distinguished by one byte. The Chinese character national standard code specified in the National Bureau of Standards GB2312-80 is used. The two bytes store the internal code of a Chinese character. The highest position of each byte is "1" as the internal code of the Chinese character machine. Because two bytes each use 7 bits, it can represent 16384 distinguishable internal codes. Taking the Chinese character "" as an example, the national standard code is 3473H, and the high position of two bytes is "1". The internal code obtained is B4F3H. In order to uniformly represent the languages of countries around the world, in 1993 the International Organization for Standardization promulgated the international standard ISO / IEC10646, or UCS (UniversalCodeSet) for short. UCS includes Chinese, Japanese, Korean and other languages. This standard specifies a unified encoding scheme for various characters in use, including Chinese characters. 3) Glyph code
Chinese character glyph codes are glyph data representing Chinese character glyphs, and are usually expressed using dot matrix, vector functions, and other methods. When a dot matrix is used to represent a glyph, the Chinese character glyph code refers to the code of the Chinese character glyph dot matrix. The glyph code is also called the glyph code, which is a glyph code of the Chinese character represented by a dot matrix. It is the output mode of the Chinese character. Depending on the requirements for outputting Chinese characters, the number of dots varies. Simple Chinese characters are 16 × 16 dot matrix, high precision Chinese characters are 24 × 24 dot matrix, 32 × 32 dot matrix, 48 × 48 dot matrix, and so on. (2) Central Processing Unit (CPU) 1. The composition of the CPU has been mentioned earlier. The CPU is mainly composed of an arithmetic unit and a controller. The block diagram of the CPU is shown in Figure 1-2. 1) Operator The operator is a component that performs processing on data. It mainly performs arithmetic and logical operations, and completes processing and processing of data. Different computers have different arithmetic structures, but the most basic structure is composed of logical components such as arithmetic / logical arithmetic unit (ALU), accumulator (ACC), register group, multiplexer and data bus. 2) The basic operations that a controller computer can perform are called instructions, and all instructions of a computer constitute an instruction system. The instruction consists of an operation code and an address code. The operation code indicates the type of operation, and the address code indicates the address where the operand and the operation result are stored.
Figure 1-2 Block diagram of the main components of the CPU The main function of the controller is to fetch the instruction from the memory and indicate the location of the next instruction in the memory. The fetched instruction is sent to the instruction decoder through the instruction register, and is issued after analysis of the instruction. Corresponding control and timing information controls and coordinates the orderly work of the various components of the computer to complete the operations specified by the instructions. The controller is composed of a program counter (PC for short), instruction register, instruction decoder, status condition register, timing generator, and micro-operation signal generator, as shown in Figure 1-3.
Figure 1-3 Controller composition block diagram (1) Program counter. When the program is executed sequentially, each time an instruction is fetched, the PC content is automatically incremented by a value to point to the next instruction to be fetched. When the program is transferred, the transfer address is sent to the PC, and then the PC points to the new program address. (2) Instruction register (IR). Used to store the current instruction to be executed. (3) Instruction decoder (ID). It is used to analyze the current instruction to determine the instruction type, the operation to be performed by the instruction, and the addressing mode. (4) Timing generator. Used to generate timing pulses and beat potentials to control the computer's orderly work. (5) Status / condition register. It is used to save the condition code generated after the execution of the instruction is completed. For example, whether the operation has overflow, whether the result is positive or negative, whether there is a carry, and so on. In addition, the status / condition register holds information such as interrupts and system operating status. (6) Micro-operation signal generator. The operation signals provided by the instructions, the timing signals provided by the timing generator, and the status signals fed back by the control function components are integrated into a specific operation sequence, thereby completing the execution control of the instruction fetch. The controller is generally composed of an instruction register (IR), a program counter (PC), a timing component, a micro-operation forming component, and a program status word register (PSW). The role of the controller is to control the various parts of the computer to work in an orderly manner. Its basic function is to access and execute instructions from the inside. There are four steps to execute instructions: instruction fetch, instruction decode, execution according to instruction operation code, and formation of the next instruction address. 2. Functions of the CPU The basic functions of the CPU are as follows. (1) Program control. The CPU controls the program execution sequence by executing instructions, which is an important function of the CPU. (2) Operation control. The realization of an instruction function requires several operation signals to complete. The CPU generates an operation signal for each instruction and sends the operation signal to different components, and controls the corresponding component to operate according to the functional requirements of the instruction. (3) Time control. The CPU performs time control on various operations. This is time control. The CPU strictly controls the entire execution time of each instruction. Simultaneously. The occurrence time, duration, and chronological order of operation signals during the execution of instructions need to be strictly controlled. (4) Data processing. The CPU processes the data by means of arithmetic operations and logical operations, and the results of the data processing are used by people. Therefore, the processing of data is the most fundamental task of the CPU. It must be pointed out that in computer systems, there is no clear dividing line between hardware and software. Generally speaking, any operation performed by software can also be directly implemented by hardware, and any instruction executed by hardware can also be completed by software. The line between software and hardware is constantly changing. Today's software may be tomorrow's hardware and vice versa. Computer hardware system composition From a functional point of view, the computer hardware system is composed of an arithmetic unit, a controller, a memory, an input device, and an output device. The controller and the computing unit are called a central processing unit (Central Processing Unit).
Basic working principle of computer von Neumann principle The first computer in the world is based on von Neumann principle. Its basic idea is: stored program and program control. Stored program means that people must input the computer's execution step sequence (ie program) and the data required for operation in a certain way and store it in the computer's memory. Program control means that when the computer is running, it can automatically take out the instructions in the program one by one, analyze them and perform the specified operations. So far, although the computer has been developed for 4 generations, its basic working principle has not changed. According to the concepts of stored programs and program control, there are actually two kinds of information flowing during the operation of a computer. One is a data stream, which includes raw data and instructions, which have been sent to main memory before the program is run, and are all encoded in binary form. When the program is running, data is sent to the arithmetic unit to participate in the calculation, and instructions are sent to the controller. The other is a control signal, which is issued by the controller according to the content of the instruction, directs each component of the computer to perform various operations or operations specified by the instruction, and controls the execution process. The instructions here must be directly understandable and executable by the computer. Computer instructions and instruction system instructions are instructions for a computer to perform a basic operation. Instructions can be understood and executed by computer hardware. An instruction is a statement of computer machine language, which is the smallest language unit of programming. The set of all instructions that a computer can execute is called the computer's instruction system. The instruction system fully illustrates the computer's ability to process data. Different types of computers have different numbers and formats of instructions. The richer and more complete the instruction system, the more convenient and flexible the programming is. The instruction system is designed according to the requirements of computer use. A computer instruction is represented by a series of binary codes. It usually includes two pieces of information: an operation code and an address code. The operation code is used to characterize the operating characteristics and functions of the instruction, that is, to indicate what operation is performed; the address code indicates the address of the data participating in the operation in the memory. In general, the source data or the result data after the operation are in the memory, and the content in the address can be accessed through the address to obtain the operand. It takes a certain amount of time for the CPU to access the memory. In order to increase the operation speed, sometimes the data or intermediate results participating in the operation are stored in the CPU register or directly in the instruction.
The full name of the computer should be "General-PurposeElectronicDigitalComputer". This name explains many of the properties of computers.
"Universal" means that the computer is not a special device, and we can compare it with a telephone. The phone can only be used as a communication tool, no other use. A computer can be used not only as a basis for calculations, but also as a communication tool as long as it has the right software, and it can be used for endless other purposes.
"Electronics" is the physical foundation of computer hardware implementation. Computers are very complex electronic devices. The operation of computers is ultimately achieved by the current and potential in electronic circuits.
"Digital" is the basis of information representation for all computer processing. In a computer, all information is represented in digital form, no matter what it is originally. Whether it is numerical values, text, graphics, sounds, etc., they are unified into binary digital representations in computers. Digitization is a basic feature of computers and an important basis for computer versatility.
"Computer" means this is a machine capable of doing calculations. The basic actions that a computer can perform are nothing more than simple calculations such as addition, subtraction, multiplication, and division of numbers. However, when it completes trillions of basic actions at an electronic speed under the command of a program, it may accomplish something very important. What we see outside the computer is the combined effect of these actions. In this sense, the computer itself doesn't have many great things. The only amazing thing is that it can act according to the command and do it quickly. In fact, what is even more remarkable is a program or software. Each program or software is special. It is designed and implemented specifically for the problem.
Another popular name for computers at present is "computer", which is a translated name broadcast from Hong Kong and Taiwan and is currently widely used. In fact, the name is not appropriate, it is easy to lead people's understanding in the wrong direction (maybe this is the intention of some people intentionally or unintentionally). We never refer to the wooden sticks that primitive people used to hit fruit on trees as "wood hands", nor do we call trains "iron feet." Because whether it is a wooden stick or a train, although each has its special purpose strength and its own "strength", they can only be useful in a narrow aspect of human hand and foot functions. The universality with hand and foot functions is It can't be compared at all. Similarly, computers can help people to complete only those things that can be transformed into calculation problems. Compared with the scope and capabilities of the human brain, the scope of computer applications is also very small.
The core processing component of a computer is the CPU (Central Processing Unit). At present, the CPUs of various types of computers are manufactured using semiconductor integrated circuit technology. Although it is not large, its internal structure is extremely complicated. The basic material of a CPU is a silicon wafer that is smaller than the size of a fingernail. Through complex processes, people have made millions and millions of tiny semiconductor components on such silicon wafers. From a functional point of view, the CPU can perform a set of operations, such as obtaining one data, calculating another result from one or several data (such as adding, subtracting, multiplying, dividing, etc.), sending out a data, and so on. Corresponding to each action is an instruction, and when the CPU receives an instruction, it performs the corresponding action. A series of instructions form a program, which may cause the CPU to complete a series of actions, thereby completing a complex task.
When the computer was born, the program that instructed the CPU to complete the work was placed outside the computer, usually as a stack of punched cards. The computer automatically reads the cards one by one in the work, and reads one to complete an action. The actual card reading is done by a card reader (interestingly, IBM started by making card readers). In this way, the working speed of the computer must be limited by the mechanical card reader, and it cannot be fast.
American mathematician von Neumann first saw the crux of the problem, and accordingly proposed the famous "stored program control principle", which led to the birth of computers in a modern sense.
The central component of a computer, in addition to the CPU, is primarily an internal memory. When the computer was born, this memory was only used to save the data being processed. When the CPU executed the instructions, it extracted the relevant data from the memory, and then stored the calculated results back to the memory. The new solution proposed by von Neumann is that the program should also be stored in memory, and the CPU should be responsible for fetching instructions from memory, executing instructions, and performing these two actions in a cyclic manner. In this way, in the process of executing the computer, the computer can completely get rid of the drag of the outside world and run automatically at its own possible speed (electronic speed). This basic idea is "the principle of stored program control", and the computer constructed according to this principle is the "stored program control computer", which is also called "von Neumann computer".
So far, all mainstream computers have been this kind of computer, and they are all discussed here. (With the deepening of computational processes and computer research, people have also recognized some of the shortcomings of von Neumann computers, and have carried out many research works aimed at exploring other computer models. But so far, the results of these work are far from It has not reached the level of manufacturing information processing equipment that can rival von Neumann computers in terms of performance, price, versatility, natural ease of use, etc. We do not intend to introduce these aspects in this article.)
From the perspective of the CPU's abstract action level, the computer's execution process is very simple. It is a simple cycle of two-step action (Figure 1.5), which is called the CPU's basic execution cycle. Each time the CPU fetches the next instruction that it is required to execute, and then follows this instruction to complete the corresponding action, iterating back and forth until the program execution is completed (an instruction that requires the CPU to stop working), or work endlessly Go on.
The CPU is an obedient and obedient commander. It always follows the command line at all times. What the program asks it to do, it does what it does. There are not many basic actions that a CPU can perform. Generally, there are dozens to one hundred or two kinds of instructions that a CPU can execute. On the other hand, in all areas of the actual society, the application of computers in all aspects of social life is very diverse and complicated. How can such a simple computer cope with such colorful and complicated social needs? The answer is actually simple: the program. With the proper arrangement of different instructions, the number of programs one can write is endless. It's like there are only 26 English letters, but letters, articles, poems, plays, and novels written in English can be infinite. Computers are not complicated in principle. It is colorful programs that enable computers to meet the endless needs of society.
This working principle of computers has two effects. On the one hand, computers are versatile, and one (or a few) computers can meet the needs of the entire society. This allows people to use large-scale industrial production to increase production efficiency, enhance computer performance, and reduce costs. . This has made computers cheaper and more powerful at the same time. On the other hand, by running different programs, different computers, or the same computer at different times, they can appear as different dedicated information processing machines, such as calculators, word processors, notepads, data information browsing and retrieval machines, accounting This processing machine, design board, game machine, etc. Even the same computer at the same time behaves as a variety of different information processing machines (as long as multiple different programs are running on this computer at the same time). It is this perfect unification of universality and specificity that makes computers the sharpest weapon in the process of human beings in the information age.
We say that the CPU is not complicated, which is in principle. Today's most advanced CPUs are extremely complex, and may even be the most complex products ever made by humans. There are many reasons for this, here are the two most important ones:
First, people have higher and higher requirements for CPU performance, because the work that needs to be done by computers is becoming more and more complicated (real society always constantly asks new questions and requires computers to solve them. Once a complex problem is solved, people will see Hope for another, more complicated problem to be solved, and will work hard), the number of instructions required to complete a job is increasing. One difficulty that can never be overcome is that it takes time for a computer to execute instructions (readers are reminded of this essential shortcoming of computers, which is extremely important for understanding computers). Although computers are currently executing instructions at incredible speeds (hundreds of millions of instructions can be executed per second), the CPU speed will always be too slow for the most complex tasks one wants to solve with a computer. In order to increase the speed of the CPU in actual calculations, many ingenious technologies have been developed, and the implementation of these technologies greatly increases the complexity of the CPU itself.
Second, there are more and more cases of data that need to be processed by computers. Early computers mainly dealt with numerical data, such as integers and real numbers (represented in the computer by a method called "floating point numbers"), and the CPU only needed to provide a batch of calculations related to these data types. instruction. With the development of computers, new application requirements are emerging. For example, when computers are widely used for the processing of graphics, image and sound signals, although in theory the CPU can be unchanged (the original instructions are sufficient to complete the work, as long as the corresponding program is written), but people have also found that adding some new Special instructions can handle these special data forms more efficiently. The addition of new instructions can greatly improve the CPU's efficiency in processing special data forms (sometimes necessary, such as in order to process high-definition 3D animation in real time). One side effect of this is that the CPU becomes more complicated.
In the past, people often said that the development of computers has gone through four stages: tubes, transistors, integrated circuits, and large-scale integrated circuits. Computers constructed in these ways were also called first-, second-, third-, and fourth-generation computers. Looking back today, this statement no longer makes much sense. The change in the device that makes a computer is not fundamental (although its significance cannot be underestimated, for example in terms of reducing costs and volume), this process of change is just a short groping phase when people seek a suitable way to make a computer. It's been completed in years. Since then, the basic manufacturing process of computers has not changed much. On the other hand, other events in the history of computers are much more important. For example: the miniaturization of computers and the emergence of personal computers, the emergence and development of computer networks, changes in the use and appearance of computers, etc. (these are all done in the scope of large-scale integrated circuits).
Today, people have been studying really new types of computers. As alternative information processing tools that are fundamentally different from ordinary computers, can they be invented? When will it appear? Can it have the performance-price ratio of today's computers, such a perfect unification of versatility and specificity? Can it replace today's popular electronic digital computers? We are waiting to see.

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?