Jumat, 22 Maret 2013

Tugas meringkas Alpro "Overview of computers and programming"

This chapter will introduce about computer, and its component, and major category of programming languages. We will discuss how C programs are processed by computer, and also describe a systematic approach to solving programming problems called software developed method.

Computer Hardware

Althought there are so many variation at price, size, and capabilities, Modern computer are similar each other in the basic. Basically, almost all computer components are same, it is:
  • Main memory
  • Secondary memory(Harddisk, CD, DVD, and Flash drives.)
  • CPU(Central Processing Unit)
  • Input devices(Mouse, keyboard, touchpad, scanner, joystick)
  • Output devices(Monitor, printer, speaker)

Memory

Memory is an essential component in any computer. Look at the picture below:

Computer components and memory relation
Memory of a computer as an ordered sequence of storage locations called memory cells.

Memory cells
Each memory cell has a unique address that indicates it relativve position in memory. The picture above shows a computer memory consisting of 1000 memory cells with address 0-999. Data that stored in a memory cell called content of the cell. At the picture above, content of memory cell 3 are number "-26" and content of memory cell 4 are letter 'H'.


A memory cell is actually a grouping of smaller unit called bytes. A byte is the amount of storage required to store a single character, such as the letter H in memory cell 4 of memory cells picture. And Bit(Binary digit) is the smallest element a computer can deal with. Binary only have two numbers, 0 and 1. and relation of bit and bytes is, 8 bits= 1 byte.

Main Memory

Main memory stores programs, data and results. Mot computers have two types of main memory. That is Random Access Memory(RAM) and Read Only Memory. RAM temporarily stores programs while they are being executed by the computer. it also temporarily stores such data as numbers, names, and even pictures while a program manipulating them. RAM is usually volatile memory, it means everything in RAM will lost when the computer is switched off.  ROM stores programs or data permanently. Computer can retrieve, but can't store information in ROM. ROM is not volatile Data stored there do not disappear when the computer is switched off.

Secondary  Storage Devices

Computer systems provide storage in addition to main memory for two reasons. First, computers need storage that is permanent or semi-permanent so that nformation can be retained during a power loss or when the computer is turned off. Second, systems typically store more information than will fit in memory. Secondary storage device are: CD, Flash drive, Harddisk.

Secondary storage devices

Central Processing Unit(CPU)

The CPU has two roles:
  • Coordinating all computer operations and performing arithmetic and logical operations on data.
  • Follow the instructions contained in a program to determine which operations should be carried out and in what order.
To process a program stored in main memory, the CPU retrieves each instruction in sequence (called fetching an instruction ), interprets the instruction to determine what should be done, and then retrieves any data needed to carry out that instruction. Next, the CPU performs the actual manipulation, or processing, of the data it retrieved. The CPU stores the results in main memory. A CPU’s current instruction and data values are stored temporarily inside the CPU in special high-speed memory locations called registers.

Input/Output(I/O) Devices

(I/O) devices be used to communicate with the computer.

Input devices: 
  • Keyboard: This device has keys for letters, numbers, and punctuation marks plus some extra keys for performing special functions. When you press a letter or digit key on a keyboard, that character is sent
    to main memory and is also displayed on the monitor at the position of the cursor. Cursor is a moving place marker.
  • Mouse: is a handheld device used to select an operation. Moving the mouse around on your desktop moves the mouse cursor displayed on the monitor’s screen.
  • Printer: A device that make a hard copy of some information that displayed on the monitor.


Computer Software

Operating System

A set of computer programs that control the interaction of the user and the computer hardware is called the operating system (OS) . Usually part of the operating system is stored permanently in a read-only memory (ROM) chip so that it is available as soon as the computer is turned on. Loading the operating system into memory is called booting the computer.
Here is a list of some of the operating system’s many responsibilities:
  1. Communicating with the computer user: receiving commands and carrying them out or rejecting them with an error message.
  2. Managing allocation of memory, of processor time, and of other resources for various tasks.
  3. Collecting input from the keyboard, mouse, and other input devices, and providing this data to the currently running program.
  4. Conveying program output to the screen, printer, or other output device.
  5. Accessing data from secondary storage.
  6. Writing data to secondary storage.

Here are list some widely used operating system of a computer.



Application Software

Application programs are developed to assist a computer user in accomplishing specific tasks.
Example:
  • Microsoft Word or OpenOffice.org , A word-processing application.
  • Microsoft Office Excel, help to create a document, a spreadsheet,.to automate tedious numerical calculations and to generate charts that depict data.
  • Microsoft Office Access or dBASE, a database management application assists in data storage and quick keyword-based access to large collections of records.

Computer Language

Software developers rarely write in the language directly understood by a computer, since this machine language is a collection of binary numbers. There are many high-level languages available. Table 1.4 lists some of the most widely used ones along with the origin of their names and the application areas that first popularized them. Although programmers find it far easier to express problem solutions in high-level languages, there remains the problem that computers do NOT understand these languages. Thus, before a high-level language program can be executed, it must first be translated into the target computer’s machine language. The program that does this translation is called a compiler


The input to the compiler is a source file containing the text of a high-level language program. The software
developer creates this file by using a word processor or editor. The format of the source file is text, which means that it is a collection of character codes. For example, you might type a program into a file called myprog.c. The compiler will scan this source file, checking the program to see if it follows the high-level language’s syntax (grammar) rules. If the program is syntactically correct, the compiler saves in an object file the machine language instructions that carry out the program’s purpose.


Executing Program

To execute a machine language program, the CPU must examine each program instruction in memory and send out the command signals required to carry out the instruction. Special program instructions are used for entering or scanning a program’s data (called input data ) into memory. After the input data have been processed, instructions for displaying or printing values in memory can be executed to display the program results. The lines displayed by a program are called the program output.
Here are picture of executing a water bill program stored in memory.


The first step of the program scans into memory data that describe the amount of water used. In step 2, the program manipulates the data and stores the results of the computations in memory. In the final step, the computational results are displayed as a water bill.


Software Development Method:

Frst five steps of the software development method to solve programming problems:
  1. Specify the problem
  2. Analyze the problem, 
  3. Design the algorithm, 
  4. Implement the algorithm, 
  5. Test and verify the completed program. Write programs in a consistent style that is easy to read, understand, and maintain.

Professional Ethic for Computer Programmers

Ethical standards of conduct in everything you do pertaining to computers. This means do not copy software that is copyright protected, do not hack into someone else’s computer, do not send files that may be infected to others, and do not submit someone else’s work as your own or lend your work to another student.

Tidak ada komentar: