Log in Sign up
Back to Discover
💻

Execution (computing)

technology Maturity 7-9

A computer follows rules to work.

Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png
It reads a list of steps. Then it does each step. This makes the computer run. It helps you play games. Do you like using computers?

34 words

A computer follows rules to work.

Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png

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!

83 words

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.

Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png

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.

Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png

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.

188 words

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.

Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png
Computers need to follow instructions to make things happen. This is how they turn data into useful results for people.

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.

Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png
Modern CPUs often use an instruction pipeline to work faster. This means they start the next step before the first one is even finished.

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."

Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png
Some errors happen because of math mistakes, like dividing by zero. Other errors happen if a program tries to use a piece of memory it does not own. Programming languages use exception handling to catch these unexpected situations.

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.

Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png
Some programs use a virtual machine to run. A virtual machine is software that acts like a real computer. This allows a program to run on many different types of hardware. Some virtual machines use a hypervisor to manage many separate environments at once.

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.

Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png
If the recipe says to add salt but you have none, that is like a runtime error. A computer can also use an interpreter to read instructions directly. This is similar to a translator reading a book aloud as you listen. Both ways help the computer finish its hard job.

371 words

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.

Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png

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.

Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png

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.

Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png

681 words
🖼️ Images & Media (1)
File:Fetch-Decode-Execute Cycle.png
Fetch-Decode-Execute Cycle.png
Up Next
💻
Control flow
Technology
More to explore

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.