Execution of a program
First, if I make a software or an executable file and want to give it to my client. Then, I will provide the file with the .exe extension. We have to know that Software is nothing but an executable file. Then, how will he use this file?
At first, he will save it to his computer's hard disk. If he wants to run this file, he has to double-click the file. After clicking, a copy of that file will load in the ram. Without loading in ram, no program runs. In ram, the memories of the active programs are mixed up. And, maybe some memories are empty. Operating systems are responsible for allocating memory for a new program to run. This is called Memory Management.
Whatever, after this, the execution of the instructions will start. According to 16-bit architecture, the first 16 zeroes and ones are the 1st instruction. Again the 2nd 0s and 1s are the 2nd instruction. Here, the size of an instruction is fixed i.e. 16-bits.
The 1st instruction will go to the processor. There are MUs (memory units) in the processor which is composed of small memory devices or registers. Among them, in instruction register, the instructions will be stored. It's also a 16-bit register. The 1st 16 binary digits are the 1st instruction.
There are CU (control units) in the processor that read, decode, and understand the meaning of the instructions. Then it sends signals to ALU (Arithmetic Logic Unit) to do/perform that 1st instruction.
This is ALU which does all calculations to run the program. But it doesn't do anything without the signal of CU. After the signal of CU, ALU will execute the instruction.
In this way, when all the instructions will be executed the program will end. This is how a program is executed in a computer.
Hard Disk---->Ram---->Processor (MU-->CU-->ALU)
......................That's it......................
Thank You
0 Comments