The first lesson Computer Architecture [Abstract]

The first lesson Computer Architecture [Abstract]

 


 

Turing machine: Different perspectives

Our natural human way of thinking is called positive thinking, positive thinking and we are called "recursive" (Iterative).

Recursion is a human instinct of positive thinking, we as a child learn to count from 1,2,3 ··· 100 ··· 10000 ··· ∞, is a typical recursive; this is a learning process step by step, from easy to difficult, from small to large, from the local to the whole, the starting point is positive;

Similarly, when learning a language, start with the alphabet Start, group of words, after simple sentences, then use "because ... so ..." "So ... since ...", "not only ... but also" and conjunctions, resulting in slightly more complex sentences this way of thinking is recursive, is positive.

In the era of the computer has not yet been created, people think the problem is also positive: [do first computer to solve a few simple questions, and then continue to optimize the complex will be bigger].

Until 1900, the German mathematician Hilbert proposed 23 historic math problems, mathematical problem is that 23 mathematicians think of mathematics.

In about 1930, Turing thinking about three of these issues:

  1. Are all mathematical problems have a clear answer to the world?

In math problems, only a small part of solvability.

  1. If there is a clear answer, if you can get the answer by calculating the limited steps?

In the solvability of the problem, only a portion.

  1. It can be calculated in a limited step math problems, whether there is an illusion of machinery, so that mechanical calculated?

I have this machine, but has long been a Turing machine exists only on paper, just an abstract mental model can be implemented automatically calculated, and after 15 solid years to appear ... 22-year-old Turing wrote "On the can the number of computing and its application in the determination of the issue ", after people have referred to this article as a" computable number ", TA is defined mathematically from the famous" Turing machine. "

Maybe you do not have views on these issues, but should be able to appreciate different perspectives.

All the world's problems, not a point of view can be resolved.

Computers and different from us, forward thinking computer is called a "recursive" (recursive), born as computer processing and manufacturing of large numbers, habits descending, down to every level of thinking.

You see, the problem is because of the different angles Turing thought, so forward thinking computer is different from the limit of things over here ... ... would be extremely Ling, list of small hills.

Maybe kind of perspective on the human body:

  • Recursive: how better than they do in all aspects of efforts to slow, small steps.

  • Recursive: how better than they do, not exactly harder than them, because it's just compete in the low-level, but they are higher than in the first insight and pattern, to a greater tolerance.

Now computers are based on the Turing machine [is a theoretical mathematical model calculates], including new computer is designed, in terms of the ability to solve problems, do not exceed the scope of the Turing machine. Delineation of a Turing machine today all computers (including running artificial intelligence program) can solve the problem of the theoretical limit.

Remember a word, the nature of the calculation is: Input Output + + operator.

Now let's see, this Turing machine mathematical model in the end look like:

  1. TAPE: a row of infinitely long tape, paddled lattice above, only two grid patterns, one is a play inside the hole (binary 0), one is not perforated (1); and the lattice Like the computer's memory are numbered from 0,1,2, ... ∞.

Because the tape is infinitely long, tape mainly to store data, the figures used are placed one by one numbered of the grid.

For the operation of computer data, we are the first to find the address of the grid, and then the data in that box out processing, content processing finished and put back into a grid.

For example, if there are couple. Husband confessed his wife, asked her to help get some tea.

Tea is positioned such that: tea in the living room coffee table white box, can show me.
His wife will go to the living room coffee table before her husband will be able to throw the box.

But if the couple is a robot it, then locate the tea is not the same.

Positioning tea should be this: tea in the living room 1, 3rd furniture, fifth position, you can show me.
Robot wife would pick up the things of this position, no matter in the end is a tea, or other, to have this number only, but to get tea.

  1. HEAD: is a small window, you can move back and forth along the tape, not only can not play punch grid view, you can also change the punch and the punch did not state; main function is to read and write data.

  2. Status Register: the role of which is to save the current state of the Turing machine, all possible states of the Turing machine is limited. Either 0 or 1.

  3. TABLE: work is a set of rules, hit the grid energy (the HEAD) referred according to the state in which the current machine and the current window to determine the next action is not perforated window, and changes the status register, so that the machine into the a new state.

It may be too abstract, strange, modern terms of view:


 

Von Neumann architecture: the secret memory, high-speed operation of the computer

After the proposed Turing machine Turing 15 years, due to mature electronic vacuum tube technology and US military funding conditions, the world's first general-purpose computer can finally be made out, this is the book ENIAC.

ENIAC Turing machine is based on the realization, based entirely on the design of the Turing machine is electronic instead of the tape, is achieved by controlling the electronic input is calculated, and the output operation.

However, ENIAC is known as the originator of the modern computer, because laid a "von Neumann architecture."

Remember a word, the nature of the calculation is: Input Output + + operator.

Von Neumann architecture computers more than before the idea of ​​a store:

  • Mixed image data as a program stored in the internal memory of a computer
  • The programs and data into the computer processing and output

Simply put, instructions and data can be put together the internal memory (memory).

In this way the CPU can fetch data fetch may be followed to complete an execution of a program.

Because the instruction and data together, the structure is simple, simple construction, it is widely used.

Computer information to be processed are varied, such as decimal numbers, text, symbols, graphics, audio, video and other information in people's eyes are different. However, for a computer, they are the same in the memory are in binary (0 and 1) represented in the form.

Memory is a very delicate part, contains hundreds of millions of electronic components, they are very small, reaching nanometer level.

These components, in fact circuit; circuit voltage variation, either 0V or is 5V, only two voltage. 5V is energized is represented by 1, 0V is off, or a 0. Therefore, a component has two states, 0 or 1.

We pass off to control these components through the circuit, it will be a combination of many 0,1.

E.g:

  • 8 Component 28 = 256 different combinations
  • Component 16 216 = 65536 different combinations

Although only a component represented by two values, but the combination of a plurality of values ​​and can represent many text, images, audio, video, symbols, etc.

Under normal circumstances we do not use a one component, but the eight components seen as a unit, even if a small number expressed, for example 1, also requires 8, which is 00000001.

Component 1 is called a bit (Bit), or 1, 8 1 byte called Component (Byte), then the component 16 is 2 Byte, 32 th is 4 Byte, so:

  • Components and parts is 8 × 1024 1024Byte, abbreviated as 1KB;
  • 8 × 1024 × 1024 components and parts is 1024KB, abbreviated as 1MB;
  • 8 × 1024 × 1024 × 1024 components and parts is 1024MB, abbreviated as 1GB.

Now you know 1 GB of memory, how many components of it, we usually refer to the file size is the number of KB, the number of MB, what it means.

If you have installed on your computer QQ, hope and friends to chat, QQ can double-click the icon to open the QQ software, enter the account number and password, then log in on it.

So, QQ is how to run up it?

First of all, one thing you want to clear, QQ software you install is stored in the hard disk (external memory on the chart).

Double-click the icon QQ, the operating system will know that you want to run this software, it will find QQ software on your hard drive, copy the data (the software is essentially a collection of a lot of data) into memory.

Correct! It is copied to memory! QQ is not running on the hard drive, but running in memory.

Since the memory read and write speeds much faster than a hard disk, a mechanical hard disk drive is rotated by the motor to read and write data, and to read and write data memory circuit, the motor speed is certainly not the transmission rate electricity (speed of light almost) fast.

So, whether it is running QQ or edit Word documents are copied data on the hard disk into memory first, in order to allow the CPU to handle, this process is called load memory (Load into Memory). Complete this process requires a special program (software), this program is called Loader (Loader).

CPU deal directly with the memory, it will read the data in memory processes, results are saved to memory. If you need to save to your hard disk before copying the data in memory to the hard disk.

For example, open a Word document, type some text, although we see not the same, but the document does not change the hard drive, the new text temporarily saved to memory, Ctrl + S will save to your hard drive. Because it will lose data after power failure memory, so if you forget to save finished editing a Word document on shutdown, and it will never be able to retrieve the contents.

Von Neumann architecture is the core of memory, like the C language is known as the most close to the von Neumann architecture programming language, C language is simply because the memory is born, it more than any one programming language We are close to the memory.

 


Moore's Law: the exponential growth of the real world

Back to the first computer ENAIC, the nature of calculation is: Input Output + + operator.

Such a calculation we already know, how can it?

Achieve it is certainly a physical system, and the nature of the physical system operator will determine the size of the force.

For example it, the first computer ENAIC with tubes instead of tape, however, the tube to achieve Turing machine: bulky, high power consumption, poor reliability, thousands of times per second to tens of thousands, are expensive.

As long as a start, residents around the house lights are dimmed. Each tube is equivalent to a small light bulb, power consumption is about 150,000 watts of electricity would be able to complete 25,000 times operations.

By 2018, the world's fastest supercomputer at Oak Ridge for one second at most to complete two billion billion floating-point operations, power consumption 2.7 kWh, equivalent to 750 million kilowatt billion times to complete the operation.

Since 1946, more than 70 years of development of the computer, in essence is to improve the energy efficiency of the process.

This 70 years there are three milestones we need to know:

  • Birth transistors, ta calculated energy consumption is reduced two orders of magnitude. This is what 50 years of the last century.
  • The integrated circuit of the present invention, ta and the calculated energy consumption is reduced by about two orders of magnitude. This is what the early 1960s. At that time electricity consumption was 100 million to complete the operation.
  • In 1965 Moore made Moore's Law: the performance of integrated circuits doubles every 12 months; Moore 1975 Moore's Law has been amended, that the 1980 performance of integrated circuits doubles every two years.

After 50 Nianxia Moore's Law of exponential growth, millions of dollars before computers, prices continued to fall until next frame ... and then to be forgotten by history ...

In 1999, Bill Gates computer show in the world speaking, if the auto industry can have the pace of development of the IT industry, so a gallon (about four liters) of gasoline should make the car run 1000 miles, and the car is priced just $ 25 .

After a time, we can use cheaper, better products, and this is the history of mankind succulent thing.

Millet phone on the use of this law, a lot of people say good millet phone (phone configuration good, cheap).

It uses the launch of the phone book of strategy, customers see the price is today's price, the meeting is in accordance with the configuration of the mobile phone comparison mobile phones on the market today to contrast.

But it is often delivered after six months, the middle time difference, after six months due to Moore's Law, then the price component is not in fact what we see today.

Therefore, we feel that we have earned, based on today's cost-effective and measurable, cost-effective and we get the same thing six months after the fact, when carefully calculate, the price is not so tempting.

But if he stood hardware manufacturing business perspective, the manufacture of the same product every 18 months, corporate income shrunk by half, which can be difficult, unless the development of enterprises can exceed Moore's Law of exponential growth, otherwise sooner or later to close .

Now as the technology industry sector in intelligent devices, networking is very popular for these manufacturing hardware business, it is not necessary to follow the trend, due to the impact of Moore's Law, their profits will become increasingly thin.

Summary of what today's conventional computers is not a panacea, because they were limited to three lines died, these three lines are:

  • Turing computability theory, which is the theoretical Turing machine
  • Von Neumann Computer Architecture
  • Physical limits of semiconductor

That is the third in front of two who are unlikely to have changed breakthrough, then the only way to improve computer performance.

Changing the physical computing system implementation process, and the physical properties of the operator system will determine the size of the force.

For example, a quantum computer.

Traditional computer limit, in fact, the traditional limits of physics; that the limits of quantum computers, quantum mechanics is a natural limit.

Amdahl's law: how to make decisions in a limited number of

Amdahl's law, is to make rapid progress in the IT industry tactics, and Amdahl's law corresponding to Moore's Law, which is the IT industry's strategy.

Amdahl in the design of computer systems, fully aware of the performance of various parts of the computer must be balanced match, to get the best overall system performance.

He will use this idea describe a simple formula:

  • The left side of the equation S: The final performance of the system upgrade
  • s to the right of the equation: a particular performance metrics (e.g., 1-fold speed memory, s is 1 fold)
  • The right of the equation p: This upgrade ratio / probability of being used (such as read and write access memory, accounting for 20% of the running time)

Assume that memory speed doubles, ie s = 2, then the whole computer to enhance performance is how much?

According to this formula, we can calculate the 11%, the result still looks good, if you have the means to memory speed to 100 times, the computer can only enhance the overall speed of about 25%, which seems not big the effective.

Each time to design a new generation of computer products, will have a variety of technological breakthroughs, are available, but considering the cost factor, as well as design complexity, require trade-offs, so what the introduction of new technology it?

Amdahl's law is the iron law in the computer industry to make a decision.

If the memory read and write footprint 20% run time computation processor 60%.

There are two techniques, may be a five-fold increase memory access speed, processor speed may be further increased by 50% due to the limitation of the development time and cost limitations, the next version uses only an improvement, should what choice?

20% of 5 times, if the effect is significant; 60% and 50%, 30% will, of course, it should adopt new memory technology.

Conclusion Amdahl's law is given, the above equation is the opposite ---- improve memory performance, increase overall computer performance only 20% (1 / [(1-0.2) + 0.2 / 6] ≈ 120%), to improve the performance of the processor if the overall system performance can be improved by 25% (1 / [(1 to 0.6) + 0.6 / 1.5] = 125%).

Next, if you also want to re-introduce a new system after one year, assuming that the performance of the processor and memory upgrade possibilities and costs to keep up with a rather, it was time to improve computer processor or memory?

Or the processor improvements, unfortunately, this time the improvement of the memory.

After improved because the last time the processor, the processor calculating the proportion of time occupied, i.e. formula p, then decreased from 60% to 50%, and the processor further improvements, water was not so large.

In fact, if it continues to improve processor, you can get about 20% performance increase, while improved memory this time to get a 25% performance increase.

Not only in computer design Amdahl's law is the iron law, in software development, debugging software performance and responsible engineers should use this iron law will be able to significantly enhance the performance of the module are optimized again.

In a large computer software development, there is a tool called the Profile, the software can simulate the circumstances of each functional module resource-intensive, so the module most resource optimization, easily doubling the performance.

Amdahl's law is not only the product design, technology selection criteria, but the principles of the entire computer industry R & D investment decision is based, that is, if the current system in which part of the computer has become the bottleneck drag, we must focus on and appropriate funds to solve the problem, which explains why the key iT technology seems to have a breakthrough at the right time.

In many cases, we are faced with a problem making the choice to limit the elements.

Many times, we always want to improve their all-round, but a person's energy and limited resources, so at some point, probably can only try in one direction.

Many people starting from intuition, that make up the short board, others feel that the long board becomes longer.

The first person to speak barrel theory, the second category of people talk long plate theory, each of which has many successful examples, there are many lessons of failure.

So many people do not know which theory to use.

You learn after the fact, Amdahl's law today, it is easy to make a decision, that is to calculate S at any time, and then choose the maximum path forward earnings like.

Published 112 original articles · won praise 344 · views 60000 +

Guess you like

Origin blog.csdn.net/qq_41739364/article/details/104815662