Thursday, 12 January 2017

How a Computer Program Works

 How a Computer Program Works

  First, let’s straighten out what we mean by computer program and application. A computer program is a set of instructions that the CPU executes. An application is a program that does something useful for the user, such as a shopping cart program that lets a user order an item from an online store, or a web browser that lets the user browse the Web.

  Either the user or an already executing program issues the command to execute a program. This command is eventually received by a software program (or a set of programs) called the operating system (OS). The operating system sees to it that the program is loaded into the computer memory and executed by the CPU. So, an operating system is a software system that controls and manages the computer resources, such as CPU time and file systems, and acts as an agent between the user and the computer hardware. To be specific, an operating system performs the following two roles:

Control program:

  An operating system controls the I/O devices and execution of the user’s programs to ensure correct operation of the computer. For example, if two programs are trying to access the hard disk at the same time, the OS decides in which order they have the access.

Resource manager:

  An operating system works as a resource manager. For example, it allocates the hardware and software resources needed by a running program such as the CPU, I/O devices, and files.

  So, an operating system interfaces between a software application and the computer hardware as shown in Figure

  When you issue a command to execute a program, you are really talking to the operating system, which in turn talks to the computer hardware, such as the CPU, for you. Generally, you write a human-readable program in a high-level language, such as Java or C++, that looks and sounds pretty much like the English language, but the computer hardware only understands the programs written in the binary bits: 1 and 0. So, a program written by your needs to be translated to a binary format.


Post a Comment

Powered by Blogger.