What language does the computer understand? Principles of computer operation

Computers have been around for a long time. The first of them were tube-based and took up a lot of space. In order to operate such a machine, a lot of maintenance personnel were required. Over time, tubes were replaced by electronic components, and computers became much smaller. Now system units computers take up very little space, and their performance has become significantly higher.

However, the basic principles of computer operation, laid down at the time of their birth, are still in effect. Data is transmitted using a signal using a "signal present or not" method. This is how the "beat" appeared. A bit is a unit of information that can take the value 0 or 1. Eight bits are combined into a byte, one byte is equal to 8 bits. The number 8 appeared due to the fact that the first computers were eight-bit and could only work with 8 bits at a time, for example, 01011001. The first zeros can be removed.

You can write any number from 0 to 255 in one byte. The specified range of numbers is very small, so larger ranges are often used: two bytes = word, two words = double word.

The computer began to work in the binary number system. Any decimal number can be written as binary. We won’t consider the detailed transformation, but if anyone is interested, write in the comments and I’ll tell you.

In a computer, it is customary to carry out calculations in binary or hexadecimal systems. The second came into use when computers became 16-bit. When writing programs in Delphi We will use the usual decimal system, because the compiler itself will convert all the numbers into the form required by the processor, but it is very important to understand what numbers the processor works with.

The hexadecimal system looks different. Each digit contains sixteen states. Therefore, one digit can take the following values: 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. The letter "A" corresponds to the number 10 in the decimal system, "B" to 11, etc.

For example, the number 1 B in hexadecimal is equal to 27 in decimal.

Throughout the materials we will occasionally encounter the hexadecimal number system. In this case, to distinguish a hexadecimal number from a decimal number, it will be preceded by a # sign, for example, #25, as is customary in Delphi.

The work with floating point numbers is completely different; we will not consider this.

Now let's look at negative numbers. If it is foreseen in advance that a number can be negative, then its length is reduced by one bit, which is allocated to the sign of the number. If the first bit is 1, then the number is negative, otherwise it is positive.

In fractional numbers, one byte can be allocated for the integer part and one for the fractional part. Due to this fractional numbers will always take up more memory, and operations with them will take longer.

1.2. Machine language

All data on the disk, including text files, is stored in binary form. Any program looks exactly the same, only it is called machine code. Let's take a closer look at it.

Any program is a sequence of commands called processor instructions. When a program runs, the computer loads its machine code into RAM and begins to execute command after command. The programmer's job is to write these instructions so that the computer understands what they want from it.

The actual program that a computer executes is a sequence of ones and zeros. This sequence is called machine language.

For example, addition command two registers in hexadecimal system looks like this: $03С3. This doesn't say much, and it's very difficult to remember such a command. It is much easier to write “add the number 1 and the number 2.”

At first, programmers wrote programs in machine code, then the first compiler appeared - a program that translated the text of programs into machine code. Thus, users began to write programs more meaningfully, and the computer itself began to do all the routine work of translating program text into machine bytecode.

1.3. History of programming languages

The language in which a program is written is called a programming language.

The first compiler wasAssembler (translated as “collector”). Writing in it is almost as difficult as in machine codes, but now not numbers were used, but numbers understandable to humanswords.

The text in the figure can be divided into three columns:

· instruction address;

· machine code instructions;

· Assembly language code.

For example, the register copy command looked like this:moveah,ebx. In this case movis a programming language command eah Andebx- register names.

In Assembly language it was easier to write a program, but a program written in machine code worked faster and more flexibly. When writing a program in machine code, the programmer is not limited by anything, but when working with assembler there are restrictions. It is not always possible to influence the result.

After the creation of assembler, programming languages ​​began to appear one after another. This is how S appeared,ADA, FoxPro, Fortran, Basic, Pascaletc. Some of them were intended only for training, others were aimed at professional programmers.

Assembly language currently mostlyused only as inserts for high-level languages, and machine codes are used to write what the compiler cannot do.

Then object-oriented programming developed. The C language turned into C++, Pascal in ObjectPascal etc.

The last major revolution taking place in programming is the transition to visual programming. This transition is currently happening. Visuality gives even more convenient means development for quickly writing code, but loses to OOP in terms of speed. Some of the commonly used languages ​​that support visual programming are Delphi and C #, although progress does not stand still and visual components appear for many other languages.

Choose best language impossible. Each of them is suitable for a certain range of tasks, and the programmer must choose the most convenient language for himself.

1.4. Execution of machine commands

In addition to bytes, there are other dimensions:

· 1 kilobyte = 1024 bytes;

· 1 megabyte = 1024 kilobytes;

· 1 gigabyte = 1024 megabytes.

· 1 terabyte = 1024 gigabytes.

· etc.

In a computer, most values ​​are powers of 2 because the computer operates in binary, and this way you can make the most of its capabilities. It is because of this that 1024 (2 to the power of 10) is used when calculating dimensions.

Let's look at some concepts.

Segment- this is the area internal memory computer.

When operating systems were 16-bit, the processor could not handle memory larger than 64 kilobytes because it maximum size an area of ​​memory that can be addressed using a two-byte address. Therefore, memory was divided into segments according to size and purpose. Currently, a 32-bit OS is used, which can address up to 4 GB of RAM, and a 64-bit OS. Therefore, we can say that the memory has become continuous. However, its division according to purpose still remains.

There are the following segment memory s:

· code segment- a memory area into which machine code is loaded, which will then be executed by the processor;

· data segment- memory area for data storage;

· stack segment- a memory area for storing temporary data and return addresses from procedures.

Each running program has its own segment of code, data and stack. Therefore, data from one program cannot interfere with data or code from another program.

Register- a memory cell in the processor. Its size depends on the bit depth. In 32-bit processors, the cells are 32-bit, but there are also 64-bit ones. The processor has several such registers, and each of them is intended for specific purposes. There are also registers general meaning, which the program can use at its discretion.

A programming language is a formal sign system designed to write computer programs. A programming language defines a set of lexical, syntactic and semantic rules that define appearance programs and actions that the performer (computer) will perform under its control.

A high-level programming language is a programming language designed to be fast and easy to use by the programmer. The main feature of high-level languages ​​is abstraction, that is, the introduction of semantic constructs that briefly describe such data structures and operations on them, the descriptions of which in machine code (or other low-level programming language) are very long and difficult to understand.

Low-level programming language (low-level programming language) is a programming language that is close to programming directly in the machine codes of the real or virtual (for example, Java, Microsoft .NET) processor used. A mnemonic notation is usually used to denote machine instructions. This allows commands to be remembered not as a sequence of binary ones and zeros, but as meaningful abbreviations of words in the human language (usually English).

Low level programming languages

Early computers had to be programmed using binary machine codes. However, programming in this way is a rather time-consuming and complex task. To simplify this task, low-level programming languages ​​began to appear, which made it possible to specify machine commands in a form more understandable to humans. To convert them into binary code were created special programs- translators.

Fig.1. An example of machine code and its representation in assembler

Translators are divided into:

    compilers - turn program text into machine code, which can be saved and then used without a compiler (an example is executable files with extension *. exe);

    interpreters - turn part of the program into machine code, execute it and then move on to the next part. In this case, an interpreter is used every time the program is executed.

An example of a low-level language is assembly language. Low-level languages ​​are focused on a specific type of processor and take into account its features, so in order to port an assembly language program to another hardware platform, it must be almost completely rewritten. There are also certain differences in the syntax of programs for different compilers. True, central processors for computers from AMD and Intel are practically compatible and differ only in some specific commands. But specialized processors for other devices, for example, video cards and phones, contain significant differences.

Advantages

Low-level languages ​​create efficient and compact programs because the developer has access to all the capabilities of the processor.

Flaws

    A programmer working with low-level languages ​​must be highly qualified and have a good understanding of the structure of the microprocessor system for which the program is being created. So, if a program is created for a computer, you need to know the device of the computer and, especially, the device and operating features of its processor;

    the resulting program cannot be transferred to a computer or device with a different type of processor;

    significant development time for large and complex programs.

Low-level languages ​​are usually used for writing small system programs, device drivers, interface modules with non-standard equipment, programming specialized microprocessors, when the most important requirements are compactness, speed and the ability to directly access hardware resources.

Assembly is a low-level language that is still widely used today.
























Back forward

Attention! Preview The slides are for informational purposes only and may not represent all the features of the presentation. If you are interested this work, please download the full version.

Lesson objectives:

  1. To form in students the concept of “ software", "operating system";
  2. Indicate the types of software and purpose;
  3. Introduce students to the types, purpose, composition and stages of loading the operating system.

Students should know:

  • types of software;
  • purpose of the main types of software;
  • definition operating system, types, purpose, composition, loading stages;
  • principles of the Windows operating system.

Students should be able to:

  • distinguish software by purpose;
  • compare software and certain type professional activity of a person;
  • distinguish between operating systems;
  • trace the stages of loading the operating system.

Lesson type: Lesson on learning new material.

Lesson type: Combined.

Form of work:

  1. Explaining new material – frontal work;

Equipment:

Software: Microsoft Office PowerPoint.

Lesson structure:

  1. Organizing time.
  2. Setting lesson goals.
  3. Updating knowledge.
  4. Explanation of new material.
  5. Testing the knowledge acquired in the lesson.
  6. Homework
  7. Summing up the lesson.

DURING THE CLASSES

I. Organizational moment

Greeting students. Teacher's opening speech

II. Setting lesson goals.

  1. How does a computer process information?
  2. The language in which the computer “thinks” – what is it?
  3. What do you think: is there a profession that does not use a computer?
  4. Who today cannot do without a computer?

III. Updating knowledge.

  1. How does a computer transmit and receive information?
  2. What computer device processes information?
  3. What types of software are basic?
  4. Without which system program is a computer impossible to operate?

IV. Explanation of new material.

Today we are starting a conversation about how a computer (processor) processes information.

A computer (PC) is a device that is not capable of thinking independently, like a human.

In order for a PC to work with information - receive it, store it, transmit it, process it - it must be taught to perform all these actions.

To teach means to build the work of a PC according to instructions that indicate what needs to be done.

The instruction must contain a strict sequence of commands in a language understandable to the PC; such an instruction is called a program.

Which is written in a language understandable to the PC, i.e. represented in machine language by ones and zeros. So,

A program is a sequence of commands that a PC executes in the process of processing information.

The human activity of creating programs is called - programming, and people are called - programmers.

The programs were created over several decades and therefore today there are a huge number of them. All programs used in a computer are called software.

Software (software) – all the variety of programs used in a modern PC.

Thus, to process information on a PC it is necessary not only Hardware hardware ” - computer system devices, but also softwaresoftware ”, which gives the PC thoughts and intelligence.

Software classification.

System software is the main software, an integral part of the PC. It is the system software that manages the complex work of all elements of a computer system, both at the hardware and software levels.

Application software - designed to perform specific user tasks without resorting to programming (text editor, graphic editor, spreadsheet and etc.)

Instrumental programming is a tool designed to create software, i.e. the same system and application software. It consists of various languages ​​and programming environments (Pascal, C, C++, etc.).

In addition to the above classification, all software can be systematized according to another parameter, namely the duration of its presence in the computer’s RAM. There are: resident programs and non-resident programs.

Resident programs are programs that are located in its RAM throughout the entire operation of the computer. Because These programs monitor the state of the computer system throughout the entire period when the computer system is turned on (for example, an operating system, an antivirus program).

Non-resident programs are programs that, upon completion of their work, are unloaded completely or partially from RAM (for example, application programs).

1. The PC works with information according to an algorithm that is specified program, and the program in turn is written in a language computer understands.

2. In order for the PC to work with information, it is necessary not just hardware– computer system devices, but also software which gives the PC thoughts and intelligence.

3. Software is divided into: systemic, applied And instrumental programming.

4. The software is systematized according to the duration of its presence in the computer’s RAM memory. resident programs and non-resident programs

V. Testing the knowledge acquired in the lesson

Fill in the missing words in the sentences:

1. Computer without programs- this is useless trash, a pile of iron. But only programs make him our assistant, friend, adviser.

2. Programming is a human activity creation programs.

3. To process information on a computer, you must have not just hardware- computer system devices (“hardware”), but also software(“software”) that gives the computer thoughts and intelligence.

4. Application software – designed to perform specific user tasks.

5. Most user friendly systemic BY.

VI. Homework

1. Learn basic definitions and concepts.

2. Textbook §2.4, orally answer questions for reflection.

operating system

Before we move on to this topic, let’s check our knowledge learned in the previous lesson.

I. Checking homework

Find and correct errors in sentences:

1. The very first programs were developed directly in object-oriented (machine) language, and ( Not), all people could develop them, and not ( only) professional programmers.

2. A program is a sequence of commands that the PC executes during storage ( processing) information.

3. All programs used in a computer are called hardware ( software).

4. Application software ( System software) manages the coordinated operation of all elements of a computer system, both at the hardware and software levels.

5. System programs ( Instrumental programming) are tools designed to create software.

“5” - all words or phrases are entered correctly;

“4” - two words or phrases are not entered;

“3” - three words or phrases are not entered;

“2” - more than three words or phrases are not entered.

II. Setting lesson goals.

1. How can you comfortably communicate with a PC without knowing its language?

2. PC without an operating system: can this happen?

3. Why an operating room Windows system is the most popular among users?

So the main one system program, without which comfortable communication with a computer is impossible, is a program called “ operating system”(OS).

III. Explanation of new material.

The operating system is the most important program.

Operating system (OS) is a set of programs that ensure the interaction of all hardware and software parts of the computer with each other and the interaction between the user and the computer.

The OS is stored on a hard drive, and can also be stored on a special system floppy disk or CD.

OS features:

1. Organization of coordinated execution of all processes in the computer.

2. Ensuring information storage in external memory and exchange with input/output devices, i.e. The OS is responsible for the correct input of information from the input device and its output to the monitor, printer, etc., as well as for the correct distribution of information on external memory disks.

3. Reaction to errors and emergency situations.

4. Carrying out dialogue and communication with the user.

The operating system is a rather complexly organized program, and it would be more appropriate to talk about it as a whole complex of programs.

Operating system structure:

Kernel - translates commands from program language into “machine code” language that the computer can understand.

Drivers are programs that control devices.

Interface is a shell through which the user communicates with the computer.

Additional material.

Students are given additional material that they become familiar with during the lesson. (Annex 1).

Windows operating system.

The OS we work with is called Windows.

This OS received this name due to the fact that the main means of communication with the user in it are Various types windows (“window” in English “Windows”).

Today it is considered “systemic - number one” throughout the world.

Programs that run under Windows are called applications.

An application is a program that runs under Windows.

Some principles of Windows OS:

1. Windows “can” work with all modern and less used devices and programs. Connection of such devices occurs automatically. The OS itself “recognizes” what is installed on the computer and configures itself to work with the new equipment. This operating principle is called Plug and play.

2. Another advantage of this OS is the unified user interface (method of communication), thanks to which different programs retain the same principles for managing their work, and you can perform operations in several ways, among which you can choose the one that is personally convenient for you. For example, several ways to resize a window (Maximize and Restore buttons, dragging outside the window, double-clicking the window title).

3. United software interface allows you to create information in some applications and transfer it to others. For example, open Paint with some drawing and MS Word with text and transfer the drawing from a graphic document to a text document.

4. The next principle inherent in Windows is the principle due to which the same image is formed on the printer as on the monitor screen (What You See Is What You Get).

You can show the text on the monitor screen and on a piece of paper and point out their identity.

OS boot steps:

Turning on or starting a computer is the most crucial moment of its operation. First of all, you need to load the OS into RAM.

1. The PC receives its first command from the ROM - microcircuits that are located on the motherboard are powered by a battery, and therefore the programs recorded in it are not erased after the computer is turned off.

It is the ROM that the processor accesses at the moment it is turned on and does this always and automatically.

ROM contains computer BIOS testing programs.

The BIOS operation is displayed on the screen with white creeping lines. At this moment, the PC checks its devices - RAM, hard drive and drives of other disks, the presence of a keyboard and other devices.

If something does not work, the BIOS reports a malfunction, otherwise it finishes its work and gives the command to boot from hard drive a special program into the RAM.

2. This program is located in a special boot sector of the disk and is called Master Boot (OS loader).

It is very small and its main purpose is to read the operating system from the system disk into RAM.

If system drives are missing from the PC, the message Non system disk appears on the monitor screen and loading of the OS stops, the PC remains inoperative.

If everything is in order, the bootloader reads the OS from the disk into RAM.

3. After loading is completed, the control OS is transferred to the command processor and appears on the screen GUI. From now on, everything we do with a computer happens under the control of the operating system.

1. Why is an operating system needed?

2. What is the structure of the operating system?

3. What are the main steps to boot a computer?

4. What operating systems do you know?

5. Learn basic definitions and concepts.

IV. Summing up the lesson.

The work of the class is assessed and the students who distinguished themselves in the lesson are named.

V. Homework.

1. Textbook §2.4-2.5, orally answer questions for reflection.

2. Using new terms and concepts from the previous and today’s lessons, create a crossword puzzle.

Draw it up on a separate sheet in several copies.

(Possible in electronic version)

Just yesterday, computer science was considered a pseudoscience in the Soviet Union. And today, the governments of some countries are complaining about attacks by Russian hackers.

And although few high-tech devices are currently being produced in Russia, we also have enough smart programmers.

Today we will talk about computer languages, their classification, essence, capabilities and prospects for use in the future.

Let's start looking at the topic with theory. First of all, let's understand the concept.

What are computer languages?

This is a system of signs and symbols that was created for “communication” between a person and a computer. After all, we can’t just go up to the computer and start explaining something to it. For this purpose, there are special code words and vocabulary that make up computer languages. And they are already reaching the computer in a form that it understands.

Today, there are more than 8 thousand different languages ​​for human-computer communication. Of course, it is impossible to know them all. Some people create a language for themselves, while others do it on a commercial basis.

But a good programmer must know at least a few basic ones perfectly.

What are the most popular programming languages?

The world of computer technology is constantly improving: new developments are appearing, and previous ones are being brought to fruition. Along with this, computer programming languages ​​appear or are streamlined. The most popular of them, which are used globally, include the following:

Of course, there are actually even more languages, but we have chosen the most basic ones, in which more than 90% of all languages ​​are written computer applications. Next, let's look at each of them in more detail.

Procedural C/C++

The languages ​​C and C++ can be called two brothers. There are claims that these are two completely different programming languages, which is not true. C++ is some improvement of the previous language, making it easier to write programs and maintaining the same syntax.

C has been developed since the seventies of the last century, and in the eighties they began to create C++. Today the latter can be called one of the most popular. It is so versatile that you can use it to create an operating system, device drivers, games and much more.

When talking about the advantages and disadvantages of this language, one cannot draw clear conclusions. There are his supporters, and there are also merciless critics. The basis for the controversy is that there is nothing unique about this programming language.

Its creators, so to speak, combined the functions and capabilities of several programming languages ​​into one. The result is a comprehensive and large-scale programming tool. But if you analyze it by individual functions, then it is inferior to highly specialized languages.

Independent and secure Java

This English computer language was developed by Sun Microsystems. Due to the fact that the written program is translated into a special bytecode, it is able to work regardless of the type of operating system or computer architecture.

This made Java the most popular language. It can be found absolutely everywhere household appliances, ATMs, city machines and almost everything related to computer technology. Most popular applications for smartphones and phones are written in Java.

Also, this programming language has enough high level security. The execution of actions within the scope of its powers is controlled by the program, which transmits commands to the devices. Therefore, when you try to perform any other task, the program immediately stops working.

If we talk about the simplicity of the language, it is worth noting studies that have shown that similar operations take 1.2-2 times longer to write than in C++. Also, several times more resources are required to execute commands. But the manufacturer’s team constantly releases many updates that minimize all the shortcomings of this programming language.

PHP that conquered the Internet

Do you want to create your own website or get into web programming? It will help you with this excellent language PHP, which is capable of creating dynamic pages. It is perhaps the most popular when creating websites and writing web applications.

Due to the fact that this programming language was created by developers with open source, they managed to bring it to perfection, and it gained wild popularity. PHP easily interacts with a wide variety of databases - from MySQL to Access.

The most popular Internet sites, such as Facebook or Wikipedia, are written in this language.

Writing on it is quite easy. There are even statistics that more than 60% of the world's programmers who work on PHP code have a fairly limited knowledge (on basic level) English language. Computer literacy in this case is limited only to knowledge of the necessary functions and procedures.

We cannot ignore the criticism of language. Despite the fact that PHP took 6th place in the rankings of the most popular languages ​​of 2015, dissatisfaction is often expressed towards it.

First of all, this language was created not by one group of programmers, but by several. Because of this, the syntax of the language is not unified and does not have a single architecture. There are different procedures that need to be described in a special way, and not according to a standardized template.

Also one of the main problems can be called the lack of compatibility between different versions languages. Earlier versions absolutely refuse to work with updates, which often creates problems in porting code from one version to another.

Relevance of knowledge and understanding of programming languages

The topic of the ability to “talk” to a computer has been gaining more and more momentum in the last decade.

And this is not surprising, because information Technology are restlessly introduced into our lives and even a toothbrush cannot do without “brains”. A specialist must program the code and service the devices. Therefore, there is always a demand for competent programmers.

Another reason why many people study computer languages ​​is the downturn in the country's economy. A person who knows how to write professionally in Java can work remotely for a foreign company creating applications and earn in a month the kind of money that he would have to save in his own country for decades.

But if you think about it, it’s quite difficult to start successfully programming and writing computer programs. English language- this is the main obstacle for beginners. After all, most programs and languages ​​are written taking into account the vocabulary of this international language.

You can learn languages ​​online

So you will have to learn a foreign language at least at a basic level, until the Russian computer language is invented.

But don't worry, the world doesn't stand still. Today you can study without leaving your home. The main thing is to have a computer and the Internet. There are many sites that provide computer training languages. The most popular ones are Codecademy, Code School and Udacity.

Internet