Thursday, 12 January 2017

Computers and Computer Programming





 Computers and Computer Programming

  You write a computer program in an English-like language, called a high-level language, such as Java or C++. Your program is eventually translated into a form that the computer understands, and it runs of course on the computer. So, to be an effective programmer, you must have a basic understanding of how computers work and how a computer executes a program after you write it.

 How a Computer Works:

  Your computer is an electronic machine. Most of the electronics of your computer are placed on the PC board (also called mother board) that contains packages of integrated circuits (also called chips). A chip combines dozens to millions of transistors. These chips form the different components of the computer, such as the processor and memory, to support the basic functions that every computer performs: inputting and outputting data, processing data, and storing data. So, from a computer program’s perspective, a computer consists components to do the following:

  • Receive data from a user.
  • Process the data according to instructions given by a program or a user.
  • Place the results somewhere (Storing data).

  Without going into the hardware details, this section presents a functional description of these components of a computer.

 Places to Store Data:

  The program code and the data need to be stored somewhere. A computer has two kinds of storage places: permanent storage and temporary storage. An example of a permanent storage device is your computer’s hard drive, which generally stores the programs and the data currently not being used by the computer. It is called permanent storage because the data survives even if the computer shuts down.

  Temporary storage is the physical memory of the computer, which is used to store the instructions from the currently running programs and their data. The running program can access the memory, also called random access memory (RAM), faster than it can access the hard drive. Therefore, memory improves the performance of the computer programs. It is called temporary (or volatile) because all data in memory is lost when the computer is shut down or rebooted.

  A very important part of any application (program) is processing some kind of data. The data comes to a computer through an input device, it’s processed by the computer for the application, and the results, in the form of output data, go to the output device.

 Input and Output Devices:

  You can look at a computer as a processor. It takes some input data from the user, processes it, and produces results in the form of output data. You use some input device to feed the input data to the computer, and the computer uses some output device to place the results or the output data. Examples of input and output (I/O) devices connected to a
computer are the monitor, keyboard, disk,and printer.

  When an application (or a program) is running, the activities of different hardware components of a computer are coordinated by the central processor unit (CPU).

 CPU: The Brain of the Computer

  The central processor unit (CPU) is the component that actually executes the instructions of a computer program, which are loaded into the memory when you give a command to run the program. Based on the instructions in the program, the CPU performs the arithmetic operations and tells the memory and the I/O devices what to do. In other words, it coordinates the activities of all the computer components just like your brain coordinates the activities of your body parts.

  So, what happens after you issue a command on the monitor to execute a program, but before the CPU actually executes the instructions in the program? In other words, how does a program tell the CPU “please execute me”?



0 comments:

Post a Comment

Powered by Blogger.

Stats