Single Chip Microcomputer entry guide series (4) analog circuits, traditional digital circuits and Single Chip Microcomputer

Source: Internet
Author: User

This article is original by purplesword (jzj1993). For more information, see. Original web site http://blog.csdn.net/jzj1993


Everyone has used calculators. Have you ever wondered how they are implemented? Here, I will not elaborate on the principle of the calculator, but will just give a brief introduction to the idea. After learning the microcontroller, you can also create a calculator. What should I do if I use a circuit for mathematical calculation? For ease of understanding, the following is a simple example.

  


In this circuit, the resistance R1 = R2. I connected the 3 V and 5 V voltages to A and B respectively. At this time, the voltage of point C is (5 + 3) /2 = 4 V. This circuit completes the operation of calculating the average value. If we use 1 V to represent number 1, the average value of 3 and 5 is 4. If we define 1mV to represent number 1, this circuit calculates that the average values of 3000 and 5000 are 4000. If I can use a clever method to design many circuits similar to the characteristics of resistor, capacitor, transistor, and other components, it can complete complicated arithmetic operations, and Square, square, square, logarithm, and other operations. This is a simple example of how the circuit helps us with mathematical computation. In this example, we cannot see the advantages of circuit computation compared to the computation with pen or paper. But if we make the circuit complex enough, its computing speed is quite fast, and as long as there is power supply, it will never tirelessly calculate, and it is not prone to errors.

We have designed a simple analog circuit calculator which can calculate the average values of two numbers. We use a voltage value to directly represent numbers. However, this circuit is not ideal in practice. When you do a basic electrical experiment to measure the voltage, you will find that there is always an error in voltage measurement, the voltmeter has an error, and the reading has an error, which is basically unavoidable. Many things in nature have errors. In addition to the differences between the value tested by the voltmeter and the actual value, the actual C-point voltage value is not exactly equal to the average of the AB voltage value, because it is difficult to ensure that the resistance values of R1 and R2 are completely consistent, the wires also have resistance. Therefore, the calculated result is more likely to be 3.99 or 4.01, rather than 4.00, which leads to an error in our calculation. If the circuit is complicated, the error will gradually accumulate and become larger. In the end, the calculation result is completely meaningless, and it is quite difficult to reduce the circuit error.

So the digital circuit was born. Compared with the inaccuracy of analog circuits, digital circuits have great advantages. Note that digital circuits are relative to analog circuits, and the nature of digital circuits is also analog circuits. Generally, the analog circuit refers to a circuit other than a digital circuit.

We humans use decimal notation to represent numbers because we have ten fingers. While binary numbers are used in digital circuits for computation, because many electronic devices usually have two very definite states, such as ON and OFF switches ", light and off ". The binary number is actually much simpler than the decimal number. In decimal, from 0 to 9. If the value is 10, it is carried to the upper digit, that is, 9 + 1 = 10. If the binary value is full, the binary value is 1 + 1 = 10. In the beginning, we will feel awkward. In fact, it is not how difficult binary is, but we are used to decimal.

In digital circuits, we use a relatively large amount of voltage to represent binary numbers, called TTL level (TTL = transistor-Transistor Logic, originally used as a logical gate circuit ). It specifies that the voltage of + 5 V is high, indicating the number "1", and the voltage of 0 V is low, indicating the number "0 ". Due to the characteristics of the circuit itself, in fact, the voltage output by the TTL level circuit is not absolutely accurate 5 V and 0 V, but the voltage> V is regarded as a high level, the voltage is regarded as low. It is precisely because of this feature that we do not need to accurately control the voltage to express the numbers we want to represent. Compared with the preceding analog average calculation circuit, this circuit has obvious advantages. This is the root cause for the wide application of digital circuits.

The introduction of digital circuits ends here. More details will be provided in the principles section. In fact, the nature of single-chip microcomputer is also a digital circuit. The traditional digital circuit we want to talk about below refers to a digital circuit other than a single-chip microcomputer such as programmable devices. Let's take a look at the difference between a single-chip microcomputer and a traditional digital circuit.

Using some commonly used traditional digital circuit devices (generally integrated circuit chips), we can design such circuits. It is an electronic table with six digital display times. The figure shows 00:00:18. It can be seen that this circuit is still quite complicated, and it takes a lot of time to design it.

  


However, the emergence of single-chip microcomputer makes it much easier to design circuits that implement the same functions. It is a circuit designed using a single-chip microcomputer. It is also an electronic table, which not only shows better results than the previous one, but also has more powerful functions. The two buttons can adjust the time and date like the two buttons on the market; the circuit is much simpler. We only need to write a specific program to the microcontroller, so that it can work in the way we designed.

If one day we want to add the watch timing function to this workbook, I am afraid the entire circuit will have to be re-designed for the previous digital circuit. But for the single-chip microcomputer, we only need to modify the program code and then write it into it again. Just like installing software on a computer, it is very convenient to modify the circuit.

  


The relationship between traditional digital circuits and single-chip microcomputer is similar to that between non-smart phones and smart phones. The biggest advantage of a smart phone is that it can install various software games, rather than smartphones, they do not have such powerful functions. The same is true for single-chip microcomputer. For the same circuit, you can download various programs for it to work according to your ideas. For single-chip microcomputer, the hardware circuit is the physical body of the single-chip microcomputer, and the program is its soul, and you who write the program is its god.


Single Chip Microcomputer entry guide series (4) analog circuits, traditional digital circuits and Single Chip Microcomputer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.