A computer follows rules to work. 
A computer follows rules to work. 
It reads a list of steps. This is called running a program. The computer does one step at a time.
First, it gets a step. Next, it figures it out. Then, it does the step. This is a cycle.
Sometimes, a program has a mistake. This is called a runtime error. It happens while the program runs.
Computers can also run many things at once. This helps you do many jobs. It is very fast!
When you run a computer program, it starts execution. This is the way a computer follows instructions. You might also hear people say they are "running" a program. 
Most computers use a special set of steps. This is called the fetch-decode-execute cycle. First, the computer gets a step. This is the fetch stage. Next, it figures out the step. This is the decode stage. Finally, it does the step. This is the execute stage. Modern computers can even do these steps at the same time. This helps them work much faster.
Sometimes, a program has a mistake. We call this a runtime error. These errors happen while the program is running. A person might see an error message on the screen. These mistakes are often called bugs. 
A computer can also use a virtual machine. This is a piece of software that acts like a real computer. It lets a program run in its own space. This can help a program work on many different types of computers. Some programs use an interpreter. An interpreter is software that reads and runs the code directly.
Execution is the way a computer program performs its tasks. You might also call this "running" a program. When a program starts, it is often called launching or invoking. This process turns written code into real actions on a device. 
Most computers follow a specific way of working. This is called the fetch-decode-execute cycle. First, the control unit performs the fetch stage to get an instruction. Next, the decode stage helps the computer understand that instruction. Finally, the execute stage carries out the action. 
Sometimes, a program runs into a problem while it is working. These are known as runtime errors. You might see these errors as a message on your screen. People often call these mistakes "software bugs." 
Computers also use special environments to manage how programs run. A runtime environment provides services that help a program work. This can include managing memory or helping the program talk to the operating system. 
Think of execution like following a recipe in a kitchen. The recipe is the program, and the chef is the processor. The chef must read the step, understand it, and then cook. 
In computing, execution is the process where a computer program is processed to perform encoded actions. You might hear people use the term "run" as a synonym for execution. When a user starts this process, it is often called launching or invoking the program. Execution is the critical bridge between written code and real-world results. It allows a processor to follow instructions and produce specific effects based on the semantics of those instructions. 
At the most fundamental level, machine code programs are executed via a programmable interface. This often involves a repetitive process known as the fetch–decode–execute cycle. The control unit manages this cycle for every single program instruction. First, the processor performs a fetch stage to retrieve an instruction. Next, the decode stage interprets what that instruction means. Finally, the execute stage carries out the actual command. In simpler CPUs, these steps happen one after another in a sequence. However, most modern CPUs use an instruction pipeline to increase speed. This allows the processor to start the next instruction before the previous one has finished. 
Programs can also be executed through different methods, such as using interpreter software. An interpreter executes source code that is already in an executable form. This differs from compiled programs that require a separate compilation operation. Execution can also occur in different modes, such as a batch process. In a batch process, the program runs without any human interaction. Alternatively, a user might interact with a program through an interactive session by typing commands. These different methods change how the software communicates with the underlying hardware.
An execution environment provides the necessary context for a program to run. One common type is a host-native environment. In this scenario, the program controls a computer via its central processing unit (CPU). The CPU interprets the program at the machine instruction level. Another important concept is the runtime system, which is a software layer providing services to an executable. A runtime environment (RTE) includes everything a program can interact with, such as the runtime system. These systems manage complex tasks like memory management, variable access, and parameter passing. They may also handle the stack and heap or provide features like garbage collection and threading.
Modern operating systems also support concurrent execution through a feature called context switching. This is a key part of multitasking operating systems. When the OS needs to swap an executable out of the environment, it performs a context switch. To do this, the OS saves the execution context data, such as register values and memory page addresses. In a Linux-based OS, this data is usually saved into a process descriptor in memory. The OS can then use process-context identifiers (PCIDs) to manage these tasks. When it is time to run the program again, the OS restores the saved data to resume execution.
Sometimes, problems arise during this process, leading to what are called runtime errors. These are errors detected during the running state of a program. They are different from compile-time errors, which are caught by a compiler before execution begins. Common runtime errors include division by zero, domain errors, and arithmetic underflow. Other issues include array subscript out of bounds errors and overflow errors. Many of these are considered software bugs. Some bugs are only discovered in a production environment when the program encounters real data. To manage these, programming languages use exception handling to catch unexpected situations in a structured way.
Virtualization offers another way to handle execution through virtual machines (VMs). A VM provides the functionality of a physical computer using a layer of software. There are two main types: system VMs and process VMs. A system VM, or full virtualization VM, provides everything needed to run an independent operating system. These often use a hypervisor to manage and share hardware across multiple isolated environments. In contrast, a process VM, like the Java or Python runtimes, executes a program in a platform-independent environment. While emulation can allow a VM to imitate different architectures, it often results in slower performance due to a thick software layer. 
🖼️ Images & Media (1)
More to explore
✨ What else?
Related topics you might enjoy
🔬 Go deeper
More advanced topics to explore
🪜 Step back
Simpler topics to build understanding
What is Nepedia?
A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.