typeface
large
in
Small
Turn off the lights
Previous bookshelf directory Bookmark Next

Chapter 27: Principles of Arithmetic Units

Ye Feng explained: "That's called the intermediate level. The recognition state is uncertain. It may be high level or low level. So in practical applications, we generally try to avoid this situation. An example is the network cable used before.

The length of the network cable is a problem. Generally, the distance between network cables should not exceed 100 meters. Because the longer the line, the greater the voltage level required to transmit power. The power supply voltage of the network cable is very low. If the network cable is too long, the signal will be weakened. Generally, an additional medium should be added in the middle.

relay equipment to enhance the signal.”

Wang Meng said: "Brother, I'm off topic. Let's talk about computer addition calculations."

Ye Feng rolled his eyes at Wang Meng and said, "You didn't ask?"

Wang Meng smiled and said: "Then you don't have to talk so much, right? Let's continue talking about computers. I just want to know if this thing can be replaced by a human."

Ye Feng continued helplessly: "Computer calculations are done through AND and NOR gates, including combined NAND gates, NOR gates and XOR gates. AND gates and OR gates are both transistors, with two inputs and one output, and the NOT gate is a diode.

One input and one output. The logical logic of an AND gate is that when all inputs are high-level 1 at the same time, the output is high-level 1, otherwise the output is low-level 0."

"The circuit design is a transistor and a current-limiting resistor. The current-limiting resistor is to prevent excessive current from burning electrical appliances, and the series protective resistor. The principle is to reduce the current by increasing the total resistance of the load. Simply put, it is a protection

The device will be blocked when a high level passes through, and the output will be low level. The circuit principle is that if the first input is low level, then the current limiting resistor will not be affected, and the other input is low level.

The output is low level."

"If the other input is high level, it will be blocked by the current limiting resistor, so the output is still low. If the first input is high level, the current limiting resistor will be blocked, and the other input is low

level, then the output is low level, and if the input is high level, the output is high level."

Ye Feng looked at Wang Meng who looked confused and said helplessly: "Simply put, the AND gate is a series circuit. When both switches are turned on, power is supplied, and the result is high level. The OR gate is a parallel circuit, as long as one of them is high level.

The result is a high level.”

Wang Meng suddenly realized and said: "Don't I understand if you said this earlier? The previous mainstream and non-mainstream are too verbose. Your explanation level needs to be improved. In the future, when you explain to others, use the latter method. It is simple and easy to understand.

Nonsense, don’t be verbose.”

Ye Feng frowned, rolled his eyes at Wang Meng and continued: "Then I will only explain the purpose, not the specific implementation. A low level represents 0, and a high level represents 1. The AND gate means that when both inputs are all 1, the output result

It’s 1, and one of them is 0, so the output results are all 0.”

"The OR gate means that both inputs are 0, then the output result is 0. If one of the inputs is 1, the output result is 1. If the input of the NOT gate is 1, the result is 0, and the input is 0, the result is 1. The NAND gate is

First AND and then negation, if both inputs are 1, the output result will be 0; if one of the two inputs is 0, the result will be all 1."

"The NOR gate is NOR first and then NOT. If both inputs are 0, the output result is 1. If one of the two inputs is 1, the result is all 0. The XOR gate consists of a first-level NOR gate and a first-level AND or

It is composed of a NOT gate. If the two input levels are the same, the output is 0. When the two input levels are different, the output result is 1."

Wang Meng found it a bit difficult to remember, so he took out his mobile phone to record what Ye Feng said.

Ye Feng watched him finish recording and continued: "We use decimal system for calculation, but the computer's power can only represent two values, namely 0 and 1. Our carry is 100000000, and the computer's carry is 2, 4, 8, 16

, that is, several powers of 2 to carry. For example, to calculate addition, the computer needs to use two XOR gates and three NAND gates."

"The input includes input A, input B, and carry C. For a simple example, if we calculate 1 plus 1, we need to consider what is written in the base after the two numbers are added, whether the sum carries a carry, and whether there is a carry in the first level

.”

"The basic calculation is to input the two input signals into the XOR gate. As I just said, the same value is 0. Then this value and the carry are input to another XOR gate. Here it counts 1 plus 1. There is no lower-level calculation, so

The carry input is 0, the result just now is 0 and the result of this carry 0 input XOR gate is still 0, then the first digit on the right is 0. This is equivalent to our ones digit being 0."

"Next, determine whether there is a carry, input 1 plus 1 to the NAND gate, and the output result is 0. Some people may think that a NOT gate should be used here, which will cause an error. For example, when the three inputs are all 1, the result will be wrong.

"

"Put this result 0 aside first, and then use the output result 0 after input A and B pass through the XOR gate, and input the 0 from carry C into the NAND gate to get the output result 1, and then put the result 1 aside with

The output result 0 is input to a NAND gate together, then the result is 1, so the carry item D of the next bit is 1, and the two inputs E and G of the next bit are both 0."

"Perform the calculation just now again. E and he are input into the XOR gate, and the output is 0. And carry D is input into the XOR gate, and the result is 1, so the second digit of the number is written as a number 1."

"At this time, the result is actually already available. Binary 10 represents the decimal number 2, but the computer will continue with the next calculation. When the input of pent and he reaches the NAND gate, the result is 1. The output result 1 is also put aside first. The input of pent and he is

The result 0 output by the XOR gate and the 1 from the carry D are put into the NAND gate to get the result 1, and together with the result 1 previously put aside, they are input into the NAND gate to get the result 0."

Wang Meng looked at Ye Feng in surprise and said, "It took you so long to calculate that 1 plus 1 is equal to 2? It would cost tens of thousands of people to calculate three-digit addition and subtraction."

Ye Feng smiled and said: "What can you do with three-digit addition? The data used in astronomy is in units of hundreds of millions. How many millions of people do you need to calculate?"

Wang Meng asked awkwardly: "The tens of millions certainly can't be counted, right?"

Ye Feng said: "Maybe if you teach thousands of people mathematics for several years and then ask them to help you calculate, they will be much faster than you. Tens of thousands of people can calculate on their fingers faster than you. If it were me, I would make some machinery

Calculating with a calculator or doing some abacus is much faster than this method, because the decimal system has great advantages over the binary system."

"The reason why computer operations cannot keep up with demand is because of this calculation method. It is like a child who can only calculate units of units. It is easy for him to calculate within ten. But when he is asked to calculate ten thousand plus ten thousand,

His calculation process is how many tens there are in 20,000 fingers. He counts them one by one. His understanding of ten thousand is ten ten ten ten. If we teach him that ten thousand is the unit, then his calculation

The speed is to stretch out two fingers, twenty thousand." Ye Feng stretched out two fingers at the same time,

"So to improve the computing speed of the computer is to optimize the algorithm, which is a mathematical problem. The transmission speed of the bus only affects the data exchange between calculators and operators. When there is a bottleneck, it will affect the computing speed, but when there is no bottleneck, it will

The bus bandwidth does not help. It is like if you have ten tons of goods and you have two trucks that can pull five tons of goods. If the road has only one lane, then it is a bottleneck. If it is a two-lane road, it is just fine. A three-lane road

It doesn't make any sense, even if there are 100 lanes but your goods and only two vehicles are dispatched at the same time, it doesn't make any sense."

Wang Meng nodded and said: "So the optical bus computer you invented is of no use?"


This chapter has been completed!
Previous Bookshelf directory Bookmark Next