Jump to content

Computer program

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Gaga654 (talk | contribs) at 19:34, 27 February 2008 (Programming). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The terms computer program, software program, or just program are the instructions for a computer.[1] A computer requires programs to function, and a computer program does nothing unless its instructions are executed by a central processor.[2] Computer programs refer to either an executable program or the source code from which an executable program is derived (e.g., compiled).

Computer source code is often written by professionals known as computer programmers. Source code is written in a programming language that follows one of two main paradigms: imperative or declarative. Source code may be converted into an executable image by a compiler. Once an executable image is requested to be run, the central processor executes the program, instruction by instruction, until termination. Alternatively, computer programs may be executed immediately with the aid of an interpreter, generated by other computer programs, or may be embedded directly into hardware.

Computer programs may be categorized along functional lines: system software and application software. And many computer programs may run simultaneously on a single computer, a process known as multitasking.

Yes I know

Program execution and storage

Typically, computer programs are stored in non-volatile memory until requested either directly or indirectly to be executed by the computer user. Upon such a request, the program is loaded into random access memory, by a computer program called an operating system, where it can be accessed directly by the central processor. The central processor then executes ("runs") the program, instruction by instruction, until termination. A program in execution is called a process.[3] Termination is either by normal self-termination or by error — software or hardware error.

Computer programs embedded into hardware

The microcontroller on the right of this USB flash drive is controlled with embedded firmware.

Some computer programs are embedded into hardware. A stored-program computer requires an initial computer program stored in its read-only memory to boot. The boot process is to identify and initialize all aspects of the system, from CPU registers to device controllers to memory contents.[4] Following the initialization process, this initial computer program loads the operating system and sets the program counter to begin normal operations. Independent of the host computer, a hardware device might have embedded firmware to control its operation. Firmware is used when the computer program is rarely or never expected to change, or when the program must not be lost when the power is off.[5]

Computer programs manually inputted

Switches for manual input on a Data General Nova 3

Computer programs historically were manually inputted to the central processor via switches. An instruction was represented by a configuration of on/off settings. After setting the configuration, an execute button was pressed. This process was then repeated. Computer programs also historically were manually inputted via paper tape or punched cards. After the medium was loaded, the starting address was set via switches and the execute button pressed.[6]

Computer programs automatically generated

Generative programming is a style of computer programming that creates source code through generic classes, prototypes, templates, aspects, and code generators to improve programmer productivity. Source code is generated with programming tools such as a template processor or an Integrated Development Environment. The simplest form of source code generator is a macro processor, such as the C preprocessor, which replaces patterns in source code according to relatively simple rules.

Software engines output source code or markup code that simultaneously become the input to another computer process. The analogy is that of one process driving another process, with the computer code being burned as fuel. Application servers are software engines that deliver applications to client computers. For example, a Wiki is an application server that allows users to build dynamic content assembled from articles. Wikis generate HTML, CSS, Java, and Javascript which are then interpreted by a web browser.

Simultaneous execution

Many computer programs may run simultaneously on a single computer, a process known as multitasking, through either software or hardware mechanisms. Modern operating systems may run multiple programs through process scheduling — a software mechanism to switch the CPU among processes frequently so that users can interact with each program while it is running.[7] Within hardware, modern day multiprocessor computers or computers with multicore processors may run multiple programs.[8]

Functional categories

Computer programs may be categorized along functional lines. These functional categories are system software and application software. System software includes the operating system which couples the computer's hardware with the application software.[9] The purpose of the operating system is to provide an environment in which application software executes in a convenient and efficient manner.[9] In addition to the operating system, system software includes utility programs that help manage and tune the computer. If a computer program is not system software then it is application software. Application software includes middleware, which couples the system software with the user interface. Application software also includes utility programs that help users solve application problems, like the need for sorting.

References

  1. ^ Stair, Ralph M.; et al. (2003). Principles of Information Systems, Sixth Edition. Thomson Learning, Inc. p. 132. ISBN 0-619-06489-7. {{cite book}}: Explicit use of et al. in: |first= (help)
  2. ^ Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 58. ISBN 0-201-50480-4.
  3. ^ Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 97. ISBN 0-201-50480-4.
  4. ^ Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 30. ISBN 0-201-50480-4.
  5. ^ Tanenbaum, Andrew S. (1990). Structured Computer Organization, Third Edition. Prentice Hall. p. 11. ISBN 0-13-854662-2.
  6. ^ Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 6. ISBN 0-201-50480-4.
  7. ^ Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 100. ISBN 0-201-50480-4.
  8. ^ Akhter, Shameem (2006). Multi-Core Programming. Richard Bowles (Intel Press). pp. pp. 11-13. ISBN 0-9764832-4-6. {{cite book}}: |pages= has extra text (help)
  9. ^ a b Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 1. ISBN 0-201-50480-4.

Further reading

  • Knuth, Donald E. (1997). The Art of Computer Programming, Volume 1, 3rd Edition. Boston: Addison-Wesley. ISBN 0-201-89683-4. {{cite book}}: Check date values in: |date= (help)
  • Knuth, Donald E. (1997). The Art of Computer Programming, Volume 2, 3rd Edition. Boston: Addison-Wesley. ISBN 0-201-89684-2. {{cite book}}: Check date values in: |year= (help)CS1 maint: year (link)
  • Knuth, Donald E. (1997). The Art of Computer Programming, Volume 3, 3rd Edition. Boston: Addison-Wesley. ISBN 0-201-89685-0. {{cite book}}: Check date values in: |year= (help)CS1 maint: year (link)