1 / 19

Computer programming

Computer programming. Computer programming. the objective of the module to gain the necessary skills to develop a computer program using one of the high level language. Introduction. What is a computer?

duy
Download Presentation

Computer programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer programming

  2. Computer programming • the objective of the module to gain the necessary skills to develop a computer program using one of the high level language.

  3. Introduction • What is a computer? a computer is a device that accepts information (in the form of digitalized data) and manipulates it for some result based on a program or sequence of instructions on how the data is to be processed. • What is a computer program? Sets of instructions that control computer’s processing of data, which are carried out to perform an intended task.

  4. what are computers used for? • Data processing: for commercial and financial purposes ( such as billing, shipping and receiving) • Scientific processing: to support science ( raw data analysis, modelling natural phenomenon) • Multimedia: (composing music, performing music, recording music, editing film and video, special effects, animation, illustration, laying out print materials, etc.)

  5. Parts of a computer • Computers’ parts can be divided into five elements: • Arithmetic and logic unit(ALU). • Central processing unit(CPU). • Main storage. • Input unit. • Output unit.

  6. Arithmetic and logic unit(ALU). • performs integer arithmetic and logic operations. • other specialized operations. • Central processing unit(CPU). • “Administrative” section • Supervises and coordinates other sections of computer. • contains an arithmetic/logic unit (ALU), control unit and internal buses. • Main storage. • called memory or internal memory. • RAM (Random Access Memory)( static or dynamic) • ROM (Read Only Memory) also is random.

  7. Input unit. • “Receiving” section • Obtains information from input devices such as Keyboard, mouse, microphone, scanner, networks. • Output Unit • Shipping” section • Takes information processed by computer • Places information on output devices • Screen, printer, networks, …

  8. Software • What is the software? Programs that run on computer.

  9. Classification of the software • operating system • control the flow of data through all the computers’ units. • Mange all the computer units • Monitoring the executions of the programs • Controlling storing data on the storage units • ……….

  10. Classification of the software • Utility programs • serve the final users • Word, excel ……

  11. Classification of the software • Programming languages • Have been used to create computer programs • Example: Java, C#, C and C++.

  12. Types of programming languages • Machine language • Only language computer directly understands • “Natural language” of computer • Defined by hardware design • Machine-dependent • Generally consist of strings of numbers • Ultimately 0s and 1s • Instruct computers to perform elementary operations • One at a time • Hard to understandfor humans • Example: • +1300042774+1400593419+1200274027

  13. Types of programming languages • Assembly language • English-like abbreviations representing elementary computer operations • Clearer to humans • Incomprehensible to computers • Translator programs (assemblers) • Convert to machine language • Example: • LOAD BASEPAYADD OVERPAYSTORE GROSSPAY

  14. Types of programming languages • High-level languages • Similar to everyday English, use common mathematical notations • Single statements accomplish substantial tasks • Assembly language requires many instructions to accomplish simple tasks • Translator programs (compilers) • Convert to machine language • Interpreter programs • Directly execute high-level language programs • Example: • grossPay = basePay + overTimePay

  15. Examples following sentence is written using Pascal as a high level programming language “ if (x=y)and (z=w)then writeln(‘the answer is Yes’);” Notes: • Easy to understand for human. • Can not be understood by CPU. • Has to be translated to low level language.

  16. Con. Examples following sentence belongs to assembly language as a low level programming language “ ADD XYZ” which can be translated to: • add the number which is existing in the memory at the location x to the number at the location y then store the result at the location z.

  17. Con. Example Notes: • Difficult to the programmer. • Still can not be understood by the CPU. • Needs to be translated to low level language.

  18. Con. Example • the above sentence needs to be translated to a sequence of zeros and ones (01) to be executed. • if ADD is translated to 0110 • x 1001 • y 1010 • z 1011 • The sentence is going to be like 0110100110101011 and is ready to be executed.

  19. What are Interpreters, compilers and assemblers? • Interpreter: it converts each high level instruction into a series of machine instructions and then immediately run (or execute) those instructions. • Compilers: convert a finished program (or section of a program) into object code. This is often done in steps. • Assemblers: program which convert the symbolic instructions ( which is written in an assembly language) into object or machine code.

More Related