Chapter 47: Let's Build a Memory
47.
"Okay, now that you have the oscillator, you can build the latch. ”
Cheng Li began to instruct.
"This cross-connects the two NAND gates...... Then continue stacking and you'll have a D-trigger.
"When you connect a D-flip-flop to an oscillator, it's a latch. ”
"The reason why it's called a latch is because this logic circuit, which has a memory function, it can remember the last entered data, lock it, save the data until it is reset. ”
"With latches, our logic circuits have the ability to store data, which is a crucial step. ”
Everyone unknowingly, all revolved around Cheng Lituan.
According to Cheng Li's instructions, a group of people got busy like bees.
"I see, using the clock frequency of the oscillator to control the data storage of the latch is a genius idea. The old man said with admiration.
When the oscillator and latch are connected, and the oscillator input 1, the latch will lock the data, which is equivalent to saving. When the oscillator enters 0, the latch clears the data to 0.
In the CPU, every time the oscillator switches 0 and 1, it is equivalent to changing and resetting the state of all the transistors in the CPU once, which is equivalent to completing an operation.
The combination of oscillator and latch is the most basic for continuous data computation.
"Well, an 8-bit latch is made up of two NOR gates, two AND gates, and one NAND gate, and then the input and the oscillator are connected together for input control. Cheng Li said.
"Such a latch can hold 8 digits. ”
......
Time passed minute by minute, and under the command of Cheng Li, everyone was busy.
At the beginning, they still had doubts and puzzles, but Cheng Li was very patient and meticulous to explain the operating principle to everyone.
So, as time went by, everyone in the secret meeting admired Cheng Li more and more, and they became more efficient in doing things.
"Yes, yes, that's it, it's an 8-bit counter. ”
......
"That's right, add an 8-1 selector there. ”
"And here, get a 3-8 decoder. ”
"Yes, yes, then put the decoder, the latch, the decoder, all together, so that you can get a 8X1_RAM array!"
RAM has a familiar name on earth, and that is memory.
RAM is a storage unit dedicated to data interaction with the CPU, which can be read and written at any time, and the speed is very fast, but as long as the power is off, all data will be lost, and it is a place to temporarily store computing data.
"This 8-bit RAM can be spliced together with two to form 16-bit RAM, so that each bit can store a binary number.
"And, most importantly, this 16-bit RAM can have an addressing function, and each digit has a 4-digit unique address to identify it, so that we can edit the data of each address!"
The old man nodded and said: "I see, the 4-digit binary address, which is exactly the day after tomorrow gossip hexadecimal." ”
Each of the hexagrams of the acquired gossip can be represented by a 4-digit binary.
Therefore, the hexagram of each acquired gossip can be represented as a set of hexadecimal systems.
On Earth, most of the addresses where data is stored are identified in hexadecimal.
However, the hexadecimal system on Earth uses ten-digit Arabic numerals, plus ABCDEF, to make up 16 identifiers.
It doesn't really matter what the identifier is used.
So in the end, Cheng Li followed the local custom and said: "That's right, we can use innate gossip and acquired gossip to represent the address of each data." ”
"The innate is yin, and the acquired is yang. ”
"Add a yin (0) to the hexagram before the hexagram of the gossip, which means the innate gossip. ”
"Yin Kun, Yin Kun, Yin Kan, Yin Xun, Yin Zhen, Yin Li, Yin Dui, and Yin Qian, respectively, represent 0, 1, 2, 3, 4, 5, 6, and 7. ”
"Yangkun, Yanggen, Yangkan, Yangxun, Yangzhen, Yangli, Yangdui, and Yangqian respectively represent, 8, 9, 10, 11, 12, 13, 14, and 15. ”
The old man looked at it and proposed: "But in this way, each number needs two words to express, it is too complicated, and it can be simplified."
"As the saying goes, dry is the sky, Kun is the earth, earthquake is thunder, Xun is the wind, Kan is water, separation is fire, Gen is the mountain, and the exchange is Ze.
"So, we can use:
"Kun, Gen, Kan, Xun, Zhen, Li, Dui, Qian, to represent 0, 1, 2, 3, 4, 5, 6, 7. ”
"Earth, mountains, water, wind, thunder, fire, water, and heaven are used to represent 8, 9, 10, 11, 12, 13, 14, and 15."
Cheng thought about it, although it is a bit cumbersome to use Chinese characters to represent each digit in the hexadecimal system, but as a Chinese heir, Cheng Li is still quite happy to see that Chinese characters can leave their footprints in the lowest structure of programming.
On Earth, because the modern scientific system, including the information age, was created by the West, it uses letters.
Although there is also Chinese language programming, it is a high-level language, and it is all the same letter in the assembly language and the underlying data structure.
Although the alphabet is a phonetic script, it has the advantage of simplicity when programming.
However, Chinese characters, as ideographic characters, are not without advantages.
The biggest feature of ideographic writing is that one word can express many meanings.
As for the problem of not being able to write, it is not a problem for these cultivators, these cultivators are supermen with extremely quick thinking, and let them use letters, I guess they are even more unaccustomed to it.
Therefore, Cheng Li finally followed the local customs and adopted the definition of this set of gossip hexadecimal identification.
In this way, the address definition of the data store is also determined.
"So let's define, data size.
"The 0s and 1s stored on 1 digit, we can call it 1 bit, it is the smallest data to store information.
"This 8-bit RAM can store 8 bits of data.
"8 bits equals 1 byte. So this RAM can also be called 1-byte RAM.
"Obviously, the capacity of this RAM is not large enough, and we need at least 64K capacity of RAM to initially meet our requirements. ”
1K of data, which is equal to 1024 bytes.
64K RAM is equivalent to another 65,536 1-byte RAM, which is not a small amount.
However, then, Cheng Li saw what it means to be a cultivator.
"Ah Wu, you have also seen the manufacturing process clearly from beginning to end, so let Cheng Li see the ability of your refining hall. ”
After the old man finished speaking, a swarthy and strong man like an iron tower walked out of the crowd.
This swarthy man, about two meters tall, was holding a huge hammer half a man high, and he looked very scary.
"Ah Wu's full name is Zhong Wu, and he is the envoy of the Refining Instrument Hall, he is just 22 years old this year, and he is also the youngest envoy of the Refining Instrument Hall. The old man introduced.
The Refining Hall is an organization on Qingling Island that specializes in refining magic weapons.
For cultivators, the scope of magic weapons is very wide, in addition to magic weapons in the traditional sense, such as spirit armor and calculators are also magic weapons, and the refining hall can be responsible for refining.
So next, Cheng Li saw for the first time, the refining methods of cultivators.
I saw Zhong Wu come to a pile of materials, stand still like an iron tower, and began to close his eyes, leaning out his divine sense, carefully sensing every cent of the materials in front of him.
After half the salary, Zhong Wu suddenly shouted, and the giant hammer in his hand slammed into the ground.
A spiritual power shock followed, and the pile of materials in front of him was shocked and all flew up at once.
Then he lifted the half-human-high hammer, as if he were lifting a feather, as lightly as a weight, like a phantom, swinging the hammer, and kept smashing into the flying materials.
Those materials had been restrained by Zhong Wu's spiritual power shock wave with a special refining technique.
The giant hammer did not really hit the material, but inspired a series of colorful light patterns visible to the naked eye, these light patterns have the energy to cut gold and etch iron, with special lines, constantly refining all materials!
"There has appeared, the 'chaotic tempering method' unique to the bell lineage. ”
"I heard that the Zhong Ancestor used this 'chaotic tempering method' to refine the only six-grade Xuanbao-level magic weapon on our Qingling Island!"
"Six-grade Xuanbao, that's a magic weapon that can only be driven during the distraction period. It's a pity that it was blown up in the Great Dark Ages thousands of years ago.
"If that six-rank treasure is still there, we won't be afraid of that Blood Demon Island. ”
In the memory of a group of people, Zhong Wu is constantly using a hammer and using the unique technique of cultivation to refine the logical spiritual path.
Then he has to construct the latch according to the logic path, and then further build the RAM!
"Hammering the weapon method looks chaotic, but it is actually orderly. As long as their faction has seen the magic weapon of the manufacturing process completely, they can use their divine sense to forcibly write down all the structures, and then use special techniques to assist in integrating all the refining processes into this chaotic hammer, which can achieve a perfect replication!"
After a cup of tea, Zhong Wu's chaotic hammer gradually slowed down and finally recovered.
The one-man-tall pile of materials in front of him had disappeared at this time.
Instead, there were 64 arrays of RAM that were quietly suspended in the air and then held up by Zhong Wu with mana.
Then Zhong Wu held this freshly made, five-meter-long and wide 64K_RAM array, and came to the old man and Cheng Li.
"Fortunately, I have refined it. ”