The raw material of a programmer’s work is a computer, which is a multipurpose machine that responds to human desires to calculate. We all have one, but do we really know how a computer works? And what are its main parts, concepts and ways of programming? In this post we explain what a computer is and how it works.
The computer
As we mentioned before, the computer is a multipurpose calculator that is responsible for calculating any operation that is programmed. To understand how a computer works, it is key that we know that only works with numbers and has internal programs that translate the data we put into numbers. When the computer responds, it will do so through numbers, which will then be transformed into images, texts or videos, among others.
Simplified structure of a computer
Processor (CPU): is the machine capable of executing programs, which receives orders from a specific program. Have a internal clock that sets a rhythm and executes an instruction, as well as registers where certain information is put. To explain how a computer works in relation to a programming language, it is vital to know how the processor works. The CPU works from a finite set of instructions, which can be: Arithmetic: addition, subtraction, multiplication and division; From them, you can build complex operations.Logics: comparisons and logical functions.Flow control: allows hop to another part or instruction. Data transfer: moves values between registers, from registers to memories and from memories to registers. It is the data reading and writing and data movement between processor registers.
Memory– is the place where the program resides and the fixed data that will be used. Devices: input and output data, such as keyboard, microphone and camera (in the case of input); results on the console or screen, such as graphics or text (in the case of output).
The memory
A fundamental object to understand how a computer works is memory. So, the memory is a computer data store. It functions as a structure of cells where a content and an address. In this case, when there are a greater number of gigabytes, there are a greater number of cells.
Memory types
ROM memory (Ready Only Memory): It is read-only memory that cannot be deleted or edited. It contains the necessary programs for a computer to work.RAM (Random Access Memory): It is a volatile, read-write memory that can randomly access any of the cells that make up the memory. It is a memory that is reset when the computer is turned off.
Programming languages
Programming languages are those that receive instructions as a numerical value. These are at different levels:
Machine code: low level. They are binary numerical values that the CPU understands. Assembler: an advance of levels. They are mnemonic values, that is, a representation of a machine language.Python and other languages: high level. Compiler programs or interpreter programs are generated that are capable of translating a specific sentence and adapting it to machine code so that the processor works. The difference between a compilation or interpretation program is that, In the first, the program is compiled to machine code and obtains an executable file; while, in interpretation, the program is interpreted line by line immediately.
What is the next step?
After reading this article, you already know a lot more about how a computer works, but there is still a lot more to learn to become an expert. That is why we invite you to learn more about what a computer is and how it works, its functions and programming languages in the Introduction to Programming Course from Scratch by . Dare to start programming!