Compiled by : S. Agarwal, Lecturer & Systems Incharge St. Xavier’s Computer Centre, St. Xavier’s College Kolkata.

March-2003

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.

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

 The languages are machine dependent. • 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: 00000011 11000011 Problems:  Binary representation of instructions and data are not easily generated.Machine Language • A set of machine instructions written using binary code that a processor can understand. manipulated. .  Writing program in machine language requires the knowledge of the internals of the computer. or understood by humans.

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

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

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

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

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 .

A BCD number is a four-bit binary group that represents one of the ten decimal digits 0 through 9.BCD CODE  BCD stands for Binary-Coded Decimal. 4 9 2 6  Example: Decimal number 4926 8421 BCD coded number 0100 1001 0010 0110 .

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

BIT PATTERN 01000001 01100001 00110001 00101011 00100000 00101101 00011100 00101100 ASCII CODE 65 97 49 43 32 45 28 44 ( . CHARACTER A a 1 + ..ASCII : Example ….

0x000024 10001111101110000000000000011000 0x000028 00000011000011111100100000100001 0x00002c 10101111101010000000000000011100 0x000030 00100101110010000000000000000001  Three types of commonly 0x000034 10101111101110010000000000011000 0x000038 00101001000000010000000001100101 used translators are : 0x00003c 00010100001000001111111111110111 1) Assembler 00111100000001000001000000000000 0x000040 0x000044 2) Compiler 00110100100001000000010000110000 0x000048 10001111101001010000000000011000 3) Interpreter00001100000100000000000011101100 0x00004c 0x000050 00000000000000000001000000100001 0x000054 10001111101111110000000000010100 0x000058 00100111101111010000000000100000 0x00005c 00000011111000000000000000001000 Translators .0x000000 00100111101111011111111111100000 0x000004 10101111101111110000000000010100 0x000008 10101111101001000000000000100000 0x00000c 10101111101001010000000000100100 0x000010 10101111101000000000000000011000 0x000014 10101111101000000000000000011100  Used to translate other 0x000018 10001111101011100000000000011100 forms of languages into 0x00001c 00000001110011100000000000011001 0x000020 00000000000000000111100000010010 machine language.

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

How does an assembler work ? .

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

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

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

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

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

.

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

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

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

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

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

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

: Providing Protection and Security ……. protection of the systems and user resources from intentional as well as inadvertent misuse. password to access system. Data encryption to protect information. . Protection generally deals with access control.     When sharing resources..S. Example: username.Jobs of an O. 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.

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

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

Batch Processing ( Mid 1950s) 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 .

could switch to another job •User could receive output as soon as their job terminated .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.

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

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

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

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

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

Sign up to vote on this title
UsefulNot useful