1 / 27

Introduction to Computing

Introduction to Computing. In Today’s world…. Computers are indispensable They are more complex than ever before. What is a computer?. A machine which solves problems for people written in the form of programs What is a program?

franz
Download Presentation

Introduction to Computing

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. Introduction to Computing

  2. In Today’s world… • Computers are indispensable • They are more complex than ever before

  3. What is a computer? • A machine which solves problems for people written in the form of programs • What is a program? - A sequence of instructions telling the computer what to do. • What is an Instruction? - Can be in Assembly language, Machine Language or High level Language.

  4. HARDWARE • Computer Organization • Computer consists of: - CPU(Central processing Unit) - Main Memory - I/O devices - Bus

  5. Computer Organization • CPU (processor) – brain of the computer. It’s function is to execute programs stored in Main memory by fetching them, examining them and executing them • CPU consists of: - Control Unit (Instruction fetch) - Arithmetic Logic Unit (Calculations) - Registers (high speed memory units)

  6. Computer Organization…contd. • How are instructions processed? • The control Unit: - fetches the instruction and decodes it, and sends control signals to the other units - Arithmetic Logic Unit performs calculations on the data

  7. Memory • What is memory? • A place for storing data and programs. • There are 3 types of memory: - Internal (within CPU..like registers) - Primary (fats..RAM) - Secondary (slow, but large capacity..Disk)

  8. I/O Devices • What is an I/O device? • Purpose is to transfer information between CPU and outside world • Egs. Keyboard, mouse, printer

  9. BUS • What is a BUS? • A set of parallel wires that can carry several bits at a time. • It carries instructions, data, address or command • 3 types: Data Bus, Address Bus, Control Bus.

  10. SOFTWARE • What is Software? • A set of programs. • In the earlier days, programs were written in 0’s and 1’s. (machine language, or Low Level Programming) • Disadvantage: Very cumbersome, and debugging becomes a problem.

  11. SOFTWARE..contd. • Remedy? • Using mnemonics. This was called Assembly Language Programming (ALP) • E.g. MOV AX, BX • But this needed a translator to convert AL to ML. This translator was called Assembler.

  12. SOFTWARE..contd. • Disadvantage of AL and ML? • They were not portable. I.e., once written, they were good only for that machine. Machine Specific. • Remedy? • Develop a language that is machine independent, and has more powerful features to suit specific needs .

  13. SOFTWARE..contd. • High Level Languages • These have the following features: • Machine Independence • Very good debugging facility • Good documentation • 1 instruction in a HLL corresponds to several in ALL or LLL

  14. SOFTWARE..contd. • High Level Languages meet specific needs such as business, scientific etc. • HLL’s come with their own translators, known as Compilers or Interpreters, and other software called Linkers, Loaders, Debuggers and Libraries. • Compilers convert the source code to object code, which is in machine language.

  15. SOFTWARE..contd. • How are HLL programs executed? • Compiler/Interpretor translates the source code. • The Loader, which is software, loads the object code into main memory. • The Linker links external files used by the current file.

  16. SOFTWARE..contd. • The editor, compiler, library, linker, loader, debugger can be integrated into one environment called the IDE, or Integrated Development Environment. MS Visual Studio is an e.g. • Compiler/Interpreter translates the source code. • The Library is a catalogue of predefined, compiled and tested functions. These contain geometric , arithmetic and other commonly used functions. • Users can build their own library functions.

  17. SOFTWARE..contd. • Programs are broadly divided into 2 categories: • Systems programs, which direct the internal operations of the computer. • E.g. Linker, Loader, Compiler • Applications Program, which solve user-oriented problems • E.g. payroll software, banking software.

  18. Introduction to Programming • Developing the simplest programs require the following steps: • Start->Problem Identification->Task Analysis-> Data analysis-> Deciding I/O-> developing algorithms->Coding->Testing-> Debugging-> Result

  19. Introduction to Programming • The algorithm phase is very important. • What is an algorithm? • A set of explicit, clear finite steps to obtain the desired output in finite time. • It is developed to produce the most efficient approach to solve a problem. • Efficient in terms of speed and memory usage. • Coding is implementing an algorithm in the programming language syntax.

  20. Intro. to Programming..contd. • The goal of programming is to develop programs that are clear, efficient and robust.

  21. HLL’s..C and C++ • C and C++ are entirely different languages. • Syntactically similar • But approach to programming in C++ is very different from C. • C++ is considered the language of the future.

  22. Object Oriented Programs • Pascal, BASIC, C, Fortran are all called Procedural languages. • This is because a program is a whole list of instructions telling the computer what to do. • What happens, when a program is very large? • List of instructions become unwieldy • Comprehension becomes tough • Unmanageable code.

  23. Object Oriented Programs • Remedy? • These problems led to development of structured programming. • Here a program is split into small functions, which is more manageable and readable. • This idea was extended to group a similar set of functions into what are called modules.

  24. Object Oriented Programs • Problems with structured programming: • Data Undervalued • Action on data is given more importance than the data itself. • This leads to inconsistencies among especially global data, which is accessed by many functions, giving undesired outputs at times.

  25. Object Oriented Programs • Remedy? • We need to hide data, or restrict it’s access to certain functions alone. • Other problems: • Non-oop languages allow users to use only built in data types. • What if the user wants to invent his own?

  26. Object Oriented Programs • This led to development of the object oriented approach. • Fundamental idea is to combine data and functions into 1 unit called OBJECT. • Here, the functions in an object only have access to the data within the object. • No external function s allowed access to that data. • Data encapsulation is born. Data and functions are encapsulated in an object.

  27. Object Oriented Programs • Data Hiding is achieved, by restricting access to data only to the member functions (or functions within an object.) • Analogy: • Corporate structure Vs. Object Oriented Design.

More Related