In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what is the principle of the internal structure of single-chip microcomputer". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "what is the principle of the internal structure of single-chip microcomputer"!
I. Analysis of the internal structure of single-chip microcomputer
Let's think about a problem: when we write an instruction into the single-chip microcomputer in the programmer, and then remove the single-chip microcomputer, the single-chip microcomputer can execute this instruction, then the instruction must be saved somewhere in the single-chip microcomputer. And this place can still keep this instruction from being lost after the power loss of the single-chip microcomputer. Where is this place? This place is the internal read-only memory of the single-chip microcomputer, namely ROM (READ ONLY MEMORY). Why is it called read-only memory? Didn't we write two numbers in just now? The original ROM in 89C51 is an electrically erasable ROM, called FLASH ROM, just now we are using the programmer, under special conditions by external equipment to write ROM operation, under the normal working conditions of the single-chip microcomputer, can only read from that side, can not write the data, so we still call it ROM.
Second, several basic concepts
1. The essence and physical phenomena of numbers.
We know that computers can perform mathematical operations, which makes it very difficult for us to understand, computers, although we do not understand its composition, but they are only some electronic components, how can mathematical operations be carried out? We do math problems such as 3745, first write 37 on paper, then write 45 below, then brain operation, and finally write the result, the raw materials of operation: 37, 45 and result: 82 are all written on paper, where is it put in the computer? In order to solve this problem, let's first do an experiment: there is a lamp here. We know that the lamp is either on or off, and there are two states. We can use'0' and'1' instead of these two states, stipulating that the light is'1' and not'0'. Now put two lights, how many states are there? Let's take a look at the list:
Please write down the three lights for yourself. 000001 010 011 100 101 110 111 Let's see, isn't this 000001101 the binary number we've learned? Originally, the light on and off is only a physical phenomenon, but when we put them in a certain order, the light on and off represents the number. Let's take one more abstract step, why are the lights on? It is because the output circuit outputs a high level and energizes the lamp. Therefore, the lights on and off can be replaced by whether the output of the circuit is high or low. In this way, the number is related to the high and low level. Think about it, what other similar examples have we seen? (naval) lights, flags, telegrams, even red and green lights.
2. The meaning of bit
Through the above experiments, we already know that the level of a lamp or a wire can represent two states: 0 and 1. This is actually a binary bit, so we call a line a bit, represented by BIT.
3. The meaning of bytes
One line can represent 0 and 1, two lines can express 0 and 1, that is, they can express 0 to 3, and three can express 0 to 7. In the computer, eight lines are usually put together and counted at the same time. It can represent a total of 256 states from 0 to 255. These eight lines, or 8 bits, are called a BYTE.
The working principle of memory
1. Memory structure
Memory is the place where data is stored. It uses the level to store data, that is to say, it actually stores the high and low levels, rather than the number 1234 as we used to think, so one of our mysteries is solved. Is there nothing mysterious about computers?
As shown on the left of the picture above: a memory is like a small drawer, a small drawer has eight small grids, each small grid is used to store "electric charge", and the electric charge is transmitted or released through the wires connected to it. As for how the electric charge is stored in the small grid, we don't have to worry about it. You can think of the wire as a water pipe, and the charge in the small grid is like water. Each small drawer in the memory is a place for data, which we call a "unit".
With such a structure, we can start to store data. if we want to put in a data 12, that is, 00001100, we just need to fill the second and third cells with electric charge. and the charge in the other cells is released (see the right of the picture above). But the problem arises. On the right side of the picture, there are many cells in a memory, and the lines are connected in parallel. When the charge is put in, the charge will be put into all the cells, and when the charge is released, the charge in each cell will be released. In that case, no matter how many cells there are in the memory, they can only put the same number, which is certainly not what we want. Therefore, we have to make a slight change in the structure. Look at the right of the image above. There is a control line on each unit. I send a signal to the control line of the unit where I want to put the data, and the control line turns on the switch so that the charge can flow freely. While there is no signal on the control line of other units, the switch will not be turned on and will not be affected. In this way, as long as you control the control lines of different units, you can write different data to each unit, again. If you want to get data from a unit, just turn on the corresponding control switch.
2. Memory decoding
So, how do we control the control line of each unit? This is not simple, isn't it just to lead the control line of each unit to the outside of the integrated circuit? It's not that simple. There are 65536 units in a piece of 27512 memory. If each wire is drawn out, the integrated circuit has to have more than 60, 000 feet. No, what should I do? Try to reduce the number of lines. We have a method called decoding, a brief introduction: one line can represent two states, two lines can represent four states, three lines can represent how many, 256 states need how many lines to represent? 8 kinds, 8 lines, so we only need 16 lines to represent the 65536 states.
3. the selection of memory and the concept of bus.
At this point, the problem of decoding is solved, let's focus on another problem. Where did the eight wires sent into each unit come from? It is connected from the computer. Generally speaking, these eight wires are connected not only to a memory but also to other devices. In this way, the problem arises, since these eight wires are not dedicated between the memory and the computer, it is not good to always connect a unit to these eight wires. For example, the value in this memory cell is 0FFH and the other memory cell is 00H, so is this line at high level or low level? Do we have to fight to see who has suffered? So we need to keep them apart. Of course, the method is very simple, when the outside wire is connected to the pin of the integrated circuit, it is not directly connected to each unit, and a set of switches is added in the middle. Usually we leave the switch on, if you really want to write data to the memory, or read the data from the memory, and then let the switch on. This set of switches is selected by three leads: the read control terminal, the write control terminal and the chip selector. To write the data to the chip, first select the chip, and then send a write signal, the switch is closed, and the transmitted data (charge) is written to the chip. If you want to read, select the film first, then send a read signal, close the switch, and the data is sent out. Read and write signals are also connected to another memory at the same time, but due to different chip selections, although there are read or write signals, there is no chip selection signal, so the other memory will not "misunderstand" and open the door, resulting in conflict. So two chips will not be selected at the same time? As long as the system is designed, it will not, because it is controlled by computing, not by us. If two pieces are selected at the same time, the circuit is malfunctioning, which is not part of our discussion.
From the above introduction, we have seen that the eight lines used to transmit data are not dedicated, but are shared by many devices, so we call it the data bus, the bus is called BUS in English, that is, the bus lane, anyone can walk. Sixteen address lines are also connected together, which is called address bus.
At this point, I believe you have a deeper understanding of "what is the internal structure and principle of single-chip microcomputer". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.