Presentation is loading. Please wait.

Presentation is loading. Please wait.

Compiled by : S. Agarwal, Lecturer & Systems Incharge St. Xaviers Computer Centre, St. Xaviers College Kolkata. March-2003.

Similar presentations


Presentation on theme: "Compiled by : S. Agarwal, Lecturer & Systems Incharge St. Xaviers Computer Centre, St. Xaviers College Kolkata. March-2003."— Presentation transcript:

1 Compiled by : S. Agarwal, Lecturer & Systems Incharge St. Xaviers Computer Centre, St. Xaviers College Kolkata. March-2003

2 WHAT IS PROGRAM A program is a sequence of instructions that a computer can interpret and execute. It is developed using high level computer languages. WHAT IS SOFTWARE Software is computer program or a set of programs, which provides the instructions which enable the computer hardware to work. Two main types of software are system software (operating systems), which control the workings of the computer, and applications, such as word processing programs, spreadsheets, and databases.

3 Types of Languages Used to Write a Software Machine Language Machine Language Assembly Language Assembly Language High Level Language High Level Language

4 Machine Language A set of machine instructions written using binary code that a processor can understand.A set of machine instructions written using binary code that a processor can understand. A processor interprets and translates machine instructions into HW signals.A processor interprets and translates machine instructions into HW signals.Example: the instruction to add 2 numbers stored in registers A and B might look like this: the instruction to add 2 numbers stored in registers A and B might look like this: Problems: Problems: Binary representation of instructions and data are not easily generated, manipulated, or understood by humans. Binary representation of instructions and data are not easily generated, manipulated, or understood by humans. The languages are machine dependent. The languages are machine dependent. Writing program in machine language requires the knowledge of the internals of the computer. Writing program in machine language requires the knowledge of the internals of the computer.

5 Assembly Language A symbolic form of machine languageA symbolic form of machine language Allows alphabetic mnemonics for operation codes and storage locationsAllows alphabetic mnemonics for operation codes and storage locations There exists one-to-one correspondence between assembly instructions and machine instructions.There exists one-to-one correspondence between assembly instructions and machine instructions. Example: M. L. Instruction: Equivalent A.L. Instruction: ADD A, B

6 Advantages …. Ease: Because of the use of mnemonics it is more understandable and easy to remember than a machine language code.. Ease: Because of the use of mnemonics it is more understandable and easy to remember than a machine language code.. Speed: programs in AL run faster than those written in high level languages. Speed: programs in AL run faster than those written in high level languages. Compactness: routines include only code that programmers want to include. Compactness: routines include only code that programmers want to include. Versatility: anything that can be done with a computer can be done with AL Versatility: anything that can be done with a computer can be done with AL

7 Problems …. Big programs in assembly language : harder to write and error prone. Big programs in assembly language : harder to write and error prone. The languages are machine dependent. The languages are machine dependent. The programmer must still be aware of the The programmer must still be aware of the internal architecture of the target machine. internal architecture of the target machine.

8 High Level Language Use English like codes that are easier to remember. Use English like codes that are easier to remember. Generally machine (architecture) independent. Generally machine (architecture) independent. Provides language constructs for specifying and manipulating complex data structures. Provides language constructs for specifying and manipulating complex data structures. Supports a variety of programming styles (i.e. linear, object oriented) Supports a variety of programming styles (i.e. linear, object oriented) Hides the low level architectural details from the programmer i. e. dose not normally require the knowledge of the internal architecture of the computers. Hides the low level architectural details from the programmer i. e. dose not normally require the knowledge of the internal architecture of the computers. Example : C, C++, Pascal, COBOL, Java Example : C, C++, Pascal, COBOL, Java

9 Binary codes Some binary codes used to represent information in a digital computer: 1) BCD Code 2) ASCII Code 3) Gray Code 4) EBCDIC Code 5) Excess-3 Code

10 BCD CODE BCD stands for Binary-Coded Decimal. BCD stands for Binary-Coded Decimal. A BCD number is a four-bit binary group that represents one of the ten decimal digits 0 through 9. A BCD number is a four-bit binary group that represents one of the ten decimal digits 0 through 9. Example: Decimal number BCD coded number

11 THE ASCII CODE ASCII is acronym for American Standard Code for Information Interchange ASCII is acronym for American Standard Code for Information Interchange Represents numbers, letters, punctuation marks and control characters Represents numbers, letters, punctuation marks and control characters Standard ASCII is a 7-bit code (127 characters) Standard ASCII is a 7-bit code (127 characters) Extended ASCII (IBM ASCII), an 8-bit code, is also very popular Extended ASCII (IBM ASCII), an 8-bit code, is also very popular Extended ASCII adds graphics and math symbols to code (total of 256 symbols) Extended ASCII adds graphics and math symbols to code (total of 256 symbols)

12 BIT PATTERN ASCII CODE CHARACTER A a ( , ASCII : Example …..

13 0x x x x00000c x x x x00001c x x x x00002c x x x x00003c x x x x00004c x x x x00005c Translators Used to translate other forms of languages into Used to translate other forms of languages into machine language. machine language. Three types of commonly used translators are : Three types of commonly used translators are : 1) Assembler 2) Compiler 3) Interpreter

14 Assembler A program that converts assembly code into machine codeA program that converts assembly code into machine code After translation creates object module i.e. the machine language representation of a programAfter translation creates object module i.e. the machine language representation of a program

15 How does an assembler work ?

16 Compiler Translates high-level code into machine language code. ) s Produces object code (Translated Instructions ready for computer ) by translating the source code ( high-level language instruction ). Object code is stored in the machine and can be used repeatedly.

17 SOURCE CODE PROGRAM COMPILER OBJECT CODE LINKAGE EDITOR LOAD MODULE OTHER OBJECT CODE MODULES TRANSLATION PROCESS

18 Digital Computer as a Multilevel Machine High Level Language Level Assembly Language Level Operating System Level Machine Language Level Microprogram Level Digital Logic Level Translation (Compiler) Translation (Assembler) Software Hardware Machine code Partial Interpretation, Partial Pass-through Interpretation (microprogram) Directly executed by hardware Applications Level

19 Interpreter Like compiler translates a high level language into machine language. Like compiler translates a high level language into machine language. Unlike compiler translates the program at the time of executing the program instruction by instruction. Unlike compiler translates the program at the time of executing the program instruction by instruction. The translated code is not stored permanently in computers memory, hence before each execution interpretation becomes necessary. The translated code is not stored permanently in computers memory, hence before each execution interpretation becomes necessary. As object code is not stored in the computer, execution of the program becomes slower because of the need for interpretation before each execution. As object code is not stored in the computer, execution of the program becomes slower because of the need for interpretation before each execution. Normally it is easier to design an interpreter than a compiler. Normally it is easier to design an interpreter than a compiler.

20 Generations of Languages 1st. Since 1940s. MACHINE LANGUAGE: binary code. 2nd. Since early 50s. ASSEMBLY LANGUAGE: mnemonics for numeric code. 3rd. Since mid 50s. HIGH-LEVEL LANGUAGES: procedural in nature. e.g. C, C++, COBOL 4th. Since late 70s. MODERN APPLICATION PACKAGES: non-procedural in nature. e.g. Structured Query Language (SQL)

21

22 SYSTEM SOFTWARE The system softwares are programs specially designed for controlling the computer hardware, ensuring the proper utilization of the computer resources and providing a convenient environment to the users of the computer to work with. Example: Operating system, Compiler, Interpreter, Loader, Linker

23 APPLICATION SOFTWARE APPLICATION SOFTWARE These are programs developed by the users of the computer to perform a specific task. They can be of two types: a) Ready Made: These are programs developed by software companies for general purpose applications. These programs can be bought and can be installed for performing some predefined job. Examples : MS-WORD, FACT, TALLY, FOXPRO etc. b) Customized or Tailor made : These are programs developed for SPECIFIC USER REQUIREMENT within an organization. These programs are developed by programmers as per the user requirements. Example: Library Management System, Hotel Management System, Railway Reservation System

24 SOFTWARE LAYERS HARDWARE OPERATING SYSTEM: SCHEDULED COMPUTER EVENTS ALLOCATES COMPUTER RESOURCES MONITORS EVENTS LANGUAGE TRANSLATORS: INTERPRETERSCOMPILERS UTILITY PROGRAMS: ROUTINE OPERATIONS MANAGE DATA PROGRAMMING LANGUAGES: ASSEMBLY LANGUAGE; FORTRAN; COBOL; PL / 1; QBASIC; PASCAL; C; C++; FOURTH GENERATION LANGUAGES SYSTEM SOFTWARE APPLICATION SOFTWARE

25 Operating System Interface manager Interface manager Human interaction made easyHuman interaction made easy interfacing, abstraction, control and sharinginterfacing, abstraction, control and sharing Resource manager Resource manager Efficient use of resourcesEfficient use of resources System and data security and protection provider. System and data security and protection provider. Control program that prevents the system from improper use and takes care of error situations Control program that prevents the system from improper use and takes care of error situations A system software that acts as an intermediary between the user and the computer and works as

26 Jobs of an O.S. : Providing User Interface …… Operating system provides these facilities for the user: Program creation : editors, debuggers, other development tools.Program creation : editors, debuggers, other development tools. Program execution : load, files, IO operations.Program execution : load, files, IO operations. Access to IO devices: Read and writes.Access to IO devices: Read and writes. Controlled access to files: protection mechanisms, abstraction of underlying device.Controlled access to files: protection mechanisms, abstraction of underlying device. System access: Controls who can access the system.System access: Controls who can access the system.

27 Jobs of an O.S. : As a Resource Manager……. Processors : Allocation of processes to processors, preemption, scheduling. Processors : Allocation of processes to processors, preemption, scheduling. Memory: Allocation of main memory. Memory: Allocation of main memory. IO devices : when to access io devices, which ones etc. IO devices : when to access io devices, which ones etc. Files: Partitions, space allocation and maintenance. Files: Partitions, space allocation and maintenance. Process : Applications, Data, objects. Process : Applications, Data, objects.

28 Jobs of an O.S. : Providing Prot ection and Security …….. When sharing resources, protection of the systems and user resources from intentional as well as inadvertent misuse. When sharing resources, protection of the systems and user resources from intentional as well as inadvertent misuse. Protection generally deals with access control. Ex: Read only file Protection generally deals with access control. Ex: Read only file Security deals usually with threats from outside the system that affects the integrity and availability of the system and information with the system. Security deals usually with threats from outside the system that affects the integrity and availability of the system and information with the system. Example: username, password to access system. Data encryption to protect information. Example: username, password to access system. Data encryption to protect information.

29 Evolution of Operating System… Serial Processing Serial Processing Batch Processing Batch Processing Multiprogramming Multiprogramming Time Sharing Time Sharing Parallel System Parallel System Distributed System Distributed System Real Time System Real Time System

30 Serial Processing (Early 1950s) Typical setup: Users would sign up for a time slot (e.g., 2am-3am) During that slot, had exclusive use of the computer Must load program into memory space, overwriting old contenDrawbacks: Inconvenient for user Wasteful of computer time (computer was idle during setup, debugging

31 Batch Processing ( Mid 1950s) Typical setup: Typical setup: Users would submit jobs on cards/tape to computer operator Operator would combine multiple jobs into a single batch job and load into card/tape reader Each user job would be executed in turn Users received output after all jobs finished the primitive operating system in charge of executing the batch job was called a resident monitor it resided permanently in memory it monitored the execution of each job in succession

32 Multiprogramming (Early 1960s) Typical setup: Users submitted jobs to computer operator Jobs were loaded into separate memory partitions Computer would begin executing first job During idle period, could switch to another job User could receive output as soon as their job terminated

33 Advantages: Interactive ness is restored. CPU is kept busy.Disadvantages: Hardware and O.S. required become significantly more complex Advantages and Drawbacks …

34 Content of Primary Memory in Single/Multi program systems OPERATING SYSTEM UNUSED MEMORY PROGRAM 1 TRADITIONAL SINGLE- PROGRAM SYSTEM OPERATING SYSTEM UNUSED MEMORY PROGRAM 1 PROGRAM 2 PROGRAM 3 MULTIPROGRAMMING ENVIRONMENT

35 Typical setup : Many users share large capacity CPU: Time in CPU divided into slices ( e.g.,2 milliseconds) Each user has access to CPU during slice. If the job is not completed within the given time slice, it is preempted and the next job gets the CPU. The preempted jobs gets the CPU back after all other jobs get a chance to get the CPU 7.11 Time Sharing (Mid 1960s)

36 New computer architectures new demands Multiprocessor Systems ( parallel systems or tightly coupled systems) More than one processor in close communication, share bus and clock, other resourcesMore than one processor in close communication, share bus and clock, other resources Can increase throughput, save on shared resources, provide greater reliabilityCan increase throughput, save on shared resources, provide greater reliability Distributed systems ( loosely coupled systems) Distribute the computation among several processors, each with its own memory & resources Processors communicate via communications lines, e.g., high-speed buses or phone lines Similar benefits as multiprocessor, but generally simpler, cheaper, more scaleable but slower.

37 New architectures (cont.) Real-time systems Some systems impose well-defined, fixed-time constraints Some systems impose well-defined, fixed-time constraints where large number of events external to the system are where large number of events external to the system are required to be taken care of. required to be taken care of. e.g., control for scientific experiments, medical imaging systems, industrial control systems. Hard real-time: Critical tasks must be completed in specified time Critical tasks must be completed in specified time Secondary storage limited or absent, data stored in short term memory or ROM Secondary storage limited or absent, data stored in short term memory or ROM Not compatible with timesharing Not compatible with timesharing Soft real-time: Critical tasks are given priority over other tasks, but no guarantees Critical tasks are given priority over other tasks, but no guarantees Limited utility in industrial control of robotics Limited utility in industrial control of robotics

38


Download ppt "Compiled by : S. Agarwal, Lecturer & Systems Incharge St. Xaviers Computer Centre, St. Xaviers College Kolkata. March-2003."

Similar presentations


Ads by Google