Popular science chip basics

If you are paying attention to the domestic chip industry, you must have a lot of confusion. How difficult is it to develop technology that can make big countries’ science and technology difficult?

In fact, chips are really difficult to say the least. Take the 5nm lithography machine as an example. It consists of more than 100,000 parts. If you count them one by one, we may not be able to produce most of them now.

However, the chip is said to be simple. In principle, as long as you have a certain knowledge base, you can figure it out. At this point, it is true that “technology knows no borders”. At least until now, relevant books, papers and other knowledge are publicly available. The main difference lies in industrial experience and technical strength.

Today, I will take a look at how simple the chip is. The goal of this article is to popularize some basic mathematical knowledge and then design the simplest chip!

Chip Basics

Chips, as the most important semiconductor products, implement specific functions. For example, the computer CPU implements rich functions such as calculation, display, reading and writing memory and hard disk data, and accepting mouse and keyboard input.

Have you ever thought about what is the basis of a chip?

Some people may immediately think of silicon. As a semiconductor material, silicon is the basis of chips. However, the drinking glass also contains silicon, which is worthless, so silicon is not the fundamental foundation. Why do chips use silicon? It’s because integrated circuits are made on silicon! The characteristic of silicon is that it can integrate a large number of circuit devices in a small area.

So the basis of the chip is the circuit? There are many types of circuits. The light bulbs and switches at home also form a circuit, which has nothing to do with the chip. The chip uses logic circuits.

Try again, the basis of the chip is a logic circuit? Well, it’s very close, but not yet. Logic circuits perform logical operations, and logical operations are also called Boolean algebra operations.

Therefore, the fundamental basis of chips is mathematics! More specifically Boolean algebra!

This conclusion is not surprising at all. Everyone knows that the foundation of physics is mathematics. Even the great physicist Newton is one of the three major mathematicians in the world, along with Archimedes and Gauss.

Boolean algebra

Understand the most basic Boolean algebra, and you will know how the machine operates, and you will also understand how to design the chip.

Next, I will introduce binary and Boolean algebra, and try to make the following content understandable to children.

Why can even children understand it? Because the mathematician Boole himself never went to college, he became self-taught and opened a primary school at the age of 19 and ran it for more than 10 years. He considers his main profession to be a teacher, and his wish is to help children find ways to understand and master complex laws.

The origin of Boolean algebra is the hope of using mathematics to express people’s logical thinking.

Among them, there are several important Boolean operations related to computers:

1. AND operation

For example: I like to eat kebabs

Let’s let A stand for barbecue and B stand for mutton skewers.

Then the above expression becomes:

Both A and B are true, and the result of the operation is true. For example, for grilled beef skewers, A=1, B=0, AandB=0. So I don’t like yakitori.

2. OR operation

For example: I like to eat barbecue or hot pot.

Let’s let A stand for barbecue and B stand for hot pot.

Then the above expression becomes:

Whether it’s barbecue or hot pot, I’ll eat either one, but of course it’s better to have both!

3. Non-operation

For example: I don’t like spicy food.

Let’s let A stand for spicy.

Then the above expression becomes:

4. XOR operation

For example: I like to eat barbecue and ice cream the most, but eating them together will cause diarrhea.

Let’s let A stand for barbecue and B stand for ice cream.

Then the above expression becomes:

It may be a little difficult to understand this operation. What does it mean? It means that A and B cannot be the same. They definitely can’t do it without barbecue and ice cream, but they can’t bear it together!

In addition to the above four Boolean operations, there are also AND, NOT, NOR, and XOR operations. It can be seen from the XOR operation that all operations can be generated by combining AND, OR, and NOT operations.

Binary operations

Let’s talk about binary arithmetic next.

The binary system uses 0 and 1 to represent all numbers. Each bit can only be 0 and 1, and when it reaches 2, it must carry.

For example, 2 in decimal system has to be carried when expressed in binary system and becomes a two-digit number 10, while 3 in decimal system is 11.

The binary system was invented by the German mathematician Leibniz more than 300 years ago. At that time, there was no trace of computers. Why did Leibniz invent a binary system that was useless at the time? To be honest, no one can figure out.

Speaking of binary, I have to talk about the gossip in our country. It is not the entertainment industry gossip that is talked about everywhere, but the real gossip.

Bagua emphasizes that two rituals generate four images, and four images generate Bagua:

See, many people think that gossip is the forerunner of binary. Liangyi is yin and yang, which is 0 and 1, Sixiang is two-digit binary digits, Bagua is three-digit binary digits, and Fuxi 64 hexagram is six-digit binary digits:

It seems that the truth is really the same. To be honest, I don’t know what gossip our ancestors invented based on it at that time.

However, someone dug out letters between Leibniz and a missionary living in Beijing at that time to try to prove that Leibniz’s invention of binary was inspired by Chinese gossip, and many people believed this statement.

The actual process was this: Leibniz wrote to the missionary at that time, hoping that he would introduce the binary system to Emperor Kangxi. The missionary saw that this was just Chinese gossip, so he wrote back to Leibniz. Gossip situation. Then Leibniz wrote an article discussing the practical application of binary in China.

Whether Leibniz was inspired by gossip is all speculation. Even if Leibniz was inspired by gossip, so what? When Leibniz invented the binary system, our Emperor Kangxi was fighting Wu Sangui, and our modern civilization was not yet civilized.

So, regarding the matter of Bagua and binary, let’s just treat it as Bagua, and let’s continue talking about binary calculations.

Suppose there are two one-bit binary numbers to be added, then there are four possibilities:

The first three cases do not require a carry. In the latter case, S is a two-digit binary number, so a carry is required. We set a separate carry flag C.

Did you find that binary addition is the same as the Boolean operation introduced above:

The sum of addition is the XOR operation of two addends

The carry flag for addition is the AND operation of two addends.

We use Boolean operators to make a logic diagram, like this:

The above is a half adder represented by Boolean operators, which can be further represented as follows:

Why is it called a half adder? This is because when calculating AB, it does not consider whether there is a carry from the previous bit, so this half adder can only calculate the addition of the last bit of the binary number.

If A and B are not numbers in the last digit, then you need to consider whether there is a carry in the calculation result of the previous digit (Cin is the carry flag of the previous digit, and Cout is the carry situation of the previous digit after the calculation of the current digit). There will be 8 situations:

This process can be implemented with 2 half adders and an OR operation:

This is the full adder:

See, we have implemented the addition of one-digit binary numbers using only four operators of Boolean algebra.

In fact, we only used three operators, because the XOR operation can be drawn as a combination of AND, OR, and NOT operations. Of course, this is too troublesome.

The same goes for the full adder. If we are not afraid of trouble, we can carefully draw a combination of XOR, AND, and OR operations.

Eight-bit binary adder

You see, computer mathematics is not difficult either.

The most amazing thing is coming next. We have to use the Boolean algebra knowledge we just learned to design the simplest chip.

This is an adder capable of adding eight-bit binary numbers.

There are still some challenges. If this adder is built, it can be considered the simplest chip. It is really a chip!

The input to this adder is 2 eight-bit binary numbers:

One is represented by A, and the eight bits are A[0],…,A[7];

The other is represented by B, and the eight bits are B[0],…,B[7];

There is also an input that is the carry flag Cin. If this adder is used alone, this input is always set to 0.

The output is S, and the eight bits are S[0],…,S[7];

The output carry flag is Cout.

Let’s take a look at what this adder looks like:

This is an eight-bit binary adder composed of 8 full adders. Isn’t it magical?

We haven’t added anything else, just the full adder we just learned. If you are interested, you can expand each full adder with 2 half adders and an OR operator.

Furthermore, you can expand each half adder using the XOR operator and the AND operator. I don’t know which readers are interested. Anyway, I will collapse if I draw it by hand.

All of this is done by EDA software during chip design.

Follow-up

At this point, we have logically designed an eight-bit binary adder chip with the simplest function.

Why do you say logically? Because so far, we haven’t used any circuit knowledge. All that’s involved is Boolean algebra, so the chip is logically possible, but not yet manufacturable.

So how to make a chip that actually works?

First, we need electronic components corresponding to the above Boolean operators to achieve the same function. Then connect these components according to the design. In this way, there is an actual circuit, which is called a gate circuit. The component that implements the above Boolean operation is called a gate component.

Ultimately, we have to make this kind of gate component on a silicon wafer, so that a gate circuit, that is, an integrated circuit, is realized on the silicon wafer.

Finally, the integrated circuit is cut out, the input and output pins are made, and then packaged, and a complete chip is produced!

Neem contact met ons op