Beruflich Dokumente
Kultur Dokumente
Introduction
Why computers? What is a computer? How are computers built? How are computers programmed?
Why Computers?
What is a computer?
Is it a calculating device Is it a data processor
Performing arithmetic operations at enormous speed
Device which operates upon data Capturing the data, manipulating the data, & managing the output
Is it a communication device
men will be able to communicate more effectively through a machine than face to face. Send / receive through channel
Of course, computer games, virtual reality games, second life, avatar etc
Characteristics of Computer
Automatic Speed Accuracy Versatility Power of remembering Diligence
How it is Built ?
In the Beginning
CRT Display
The Box
CD-ROM Drive
Mouse
PSP - Bridge Course 2010-2013 Batch- AS
Evolution Of Computers
First Generation (1942 1955)
Vacuum tubes, electro magnetic relay memory, punched cards Machine & Assembly languages
Transistors, magnetic core memory, tapes & disks Batch OS, High level Programming languages
ICs, larger capacity disks, mini computers Time sharing OS, unbundling s/w from h/w
ICs, VLSI, micro processors, PCs, Computer networks OS for PCs, GUI, Windows, UNIX
ICs, ULSI, Optical disks, Dual core, laptops, notebooks WWW, Internet, multimedia applications
Processor: Brains Memory: Scratch paper Disk : Long term memory I/O: Communication
Ports
CPU RAM
Sound card
Network card
Speakers
Computer
PSP - Bridge Course 2010-2013 Batch- AS
Input Unit
Output Unit
Control Unit
PSP - Bridge Course 2010-2013 Batch- AS
Memory Unit
CPU
Arithmetic and Logical Unit (ALU)
Input Unit
Output Unit
Control Unit
PSP - Bridge Course 2010-2013 Batch- AS
Hardware Vs Software
Hardware is best described as a device that is physically connected to the computer or something that can be physically touched. Hardware serve as the delivery system for software solutions. Software is a general term used to describe a collection of computer programs, procedures, and documentation that perform some task on a computer system. Software is an ordered sequence of instructions for changing the state of the computer hardware in a particular sequence.
Hardware Vs Software
Language of Computers
Computers speak binary. Binary language consists of combinations of 1's and 0's that represent characters of other languages Dont make the mistake of thinking that little 1's and 0's are running around inside of the computer. We humans prefer to think of 1's and 0's because its easier than visualizing positive and negative current flows or open and closed circuits which is what actually happens inside computers.
Do you think that the above instructions make any sense ? Of course, these instructions have no real meaning to you, but they are exactly the kind of instructions that a computer expects. Instructions like these are called "machine code" and each one represents a typical operation that a computer might perform.
Conclusion about machine language ( first generation language) Even though writing code in machine language is very appropriate for a computer, but it is extremely confusing for a programmer.
ASSEMBLY LANGUAGE
Machine Code Assembly Code
In assembly languages, set of symbolic names are used to represent the operations. So writing assembly code is simpler than writing machine code.
Limitations Code written in assembly language is machine dependent. (code written for one machine will not run on another machine.)
Advantages of high level languages 1. It is easier to write programs in high level language than other low level and assembly languages 2. Code written in high level languages are portable 3. It also offers maintainability
PROGRAMMING ENVIRONMENT
Programming Environment is the environment in which programs are created, tested and executed.
Writing Programs Use some text editors for typing programs Save the programs with proper extensions in the desired directory
Execution of a program involves the following steps: Translation of the program (Why?)
Linking of the program with other programs needed for its execution Relocation of the program to execute from the specific memory area allocated to it Loading of the program in the main memory for the purpose of execution
ROLE OF TRANSALTAORS
If we write programs in machine language, it will be understandable by the computer and can be executed directly. But if we write code in either assembly language or high level language, is it possible to execute them directly? Here comes the role of Translators which translates the code written in assembly language or high level language to machine code. The following are the categories of translators Assemblers Compilers Interpreters
Stages of a Program
(Basic, Pascal, C)
(sometimes bypassed)
(100110101)
(interpretation)
Microprocessor Level (optional)
Translators
Assembler: Is a translator program which translates the code written in assembly language to corresponding machine language. Compiler: Is a translator program which translates the code written in high level language to corresponding machine language. Interpreters: Is a translator program which translates the code written in high level language to corresponding machine language.
Compiler
A compiler translates a complete source program written in high level languages into machine code. The whole source code file is compiled in one go, and a complete, compiled version of the code (object code) is produced. This can be saved on some secondary storage medium (e.g. floppy disk, hard disk...) and can be used later. In compilation, The program can only be executed once translation is complete Any changes to the source code require a complete recompilation. Once compiled, it can be re-run any number of times.
Interpreter
An interpreter performs on-the-fly translation It provides a means by which a program written in source language can be understood and executed by the CPU line by line. As the first line is encountered by the interpreter, it is translated and executed. Then it moves to the next line of source code and repeats the process.
In interpretation, Statements from the source program are fetched and executed one by one. No copy of the translation exists, and if the program is to be re-run, it has to be interpreted all over again.
PHASES OF COMPLIERS
A typical compiler consists of two phases of compilation. Analysis phase Synthesis phase. In analysis phase, the source program is divided in to constituent pieces and creates intermediate representation. There will be lexical, syntactic and semantic analysis. In synthesis phase, the target program is generated from the intermediate representation. Code optimization will also be handled at this phase.
Scan the source program and separate the lexical units in it.
Example : c = a + b;
At the end of lexical analysis, the following lexical units are identified. cab=+ ( here c a b are the identifiers and = + are the operators)
PROGRAM LINKING
Linking is the process of putting together other program files and functions (external references) that are required by the program.
PROGRAM LOADING
During execution, the executable object code is loaded into the main memory by the loader program and the program instructions are executed.
6. Jumps to a startup routine that copies the programs arguments from the stack to registers and calls the programs main routine
4GL
Assembly Language
IDEs
An integrated development environment (IDE) is a programming environment that has been packaged as an application program, typically consisting of a code editor, a compiler, a debugger, and a graphical user interface (GUI) builder. The IDE may be a standalone application or may be included as part of one or more existing and compatible applications. Most IDEs have tools that allow you to: Write and edit source code See errors as you type See highlighted code syntax Automate repetitive tasks Compile code Browse class structures Use drag-and-drop utilities for easy building of features, such as graphic objects or creating database connections
The choice depends on the requirements to be implemented and on external factors such as availability, support and training.