Post on 15-Mar-2018
Prof. Anuja Nair
Assistant Professor
Computer Engineering Department
Institute of Technology
Nirma University
Computer
• It is an electronic device which accepts data from our outside world (standardinput devices) and manipulates or process it according to instruction given at highspeed.
• It has memory to store large amount of data and can process it in accurate form.
• Computer is also called data processor because it can store, process and retrievedata whenever required.
• A computer follows a series of instructions, programmed into its memory by itsuser and outputs the information.
• Difference between data and information?
Computer System Characteristics
• Speed and accuracy
• Diligence and maintainence
• Vast storage media
• Time factor
• Permanent
• Versatility
Applications of computer system
• There are various areas where computer can be used:• Reservation system (air, railway, bus)
• Banking system
• Library management
• Hospital management
• Hotel management
• Space technology
• Weather forecasting
Generation of computers
• Refer the document “Generation of computers” uploaded on blog.
Computer Architecture
Hardware
• Computer hardware is the collection of physical elements that constitutesa computer system.
• Computer hardware refers to the physical parts or components of a computer such asthe monitor, mouse, keyboard, computer data storage, hard drive disk (HDD), systemunit (graphic cards, sound cards, memory, motherboard and chips), etc. all of which arephysical objects that can be touched
Software
• Computer software, or simply software, also known as computer programs, is thenon-tangible component of computers.
• It represents the set of programs that govern the operation of a computer system andmake the hardware run.
• Computer software contrasts with computer hardware, which is the physicalcomponent of computers.
• Computer hardware and software require each other and neither can be realisticallyused without the other.
• To help the computer to perform specific functions for itself. One major example isoperating system. All computers require an operating system. E.g. OS ( Disk operatingSystem, Windows, Linux, UNIX, Mac etc.)
Types of Software
• System Software• To control operation and extend the processing capabilities of computer system.
• e.g. Operating System, Compiler, Assembler, etc.
• Application Software• Designed for user specific need.
• General purpose
• e.g. MS Office, Excel etc.
• Specific purpose
• Custom built according to requirement of user.
System Software
• Operating System
• Compiler : translates high level language to machine level language
• Assembler : translates assembly or low level language to machine language
• Loader : which loads OS part and object program into main memory for executionpurpose. E.g. bootstrap loader.
• Linker : which binds code of source and library file to make executable programs.
• Editor : used to write a program.
• Translator : which converts one language into other. (Compiler, Assembler, Interpreter)
• Macro processor : Replace symbolic meaning into equivalent code. Also, called pre-processor.
• Interpreter : translates line by line high level language into machine language.
System software vs. Application softwareSr. No. Particular System software Application software
1. Purpose Comprises of those programs whichdirects the computer.
It is the software developed forsolving business problems.
2. Varyingnature
Varies from computer to computer. Varies from organization toorganization.
3. Language Written in low-level language. Written in high level language.
4. Knowledge Detail knowledge of hardware isrequired.
Requires detailed knowledge oforganization.
5. Use Use to improve the performance andmaximum utilization of systemresources.
Use to improve speed and quality of abusiness activity.
6. Developedby
The manufactures along with thehardware usually supply systemsoftware.
Developed by individuals or suppliedby software vendors as generalizedapplication software.
Register
• Hardware register, a placeholder for information about some hardware condition
• Processor register, a component inside a central processing unit for storing information
• e.g. Program Counter (PC)
Central Processing Unit (CPU)
• A central processing unit (CPU) is the hardware within a computer that carries outthe instructions of a computer program by performing the basic arithmetical, logical,and input/output operations of the system.
• CPU is a combination of ALU (arithmetic logic unit) and CU (Control Unit).
• ALU• Here actual execution instruction takes place during processing operation.
• It performs all arithmetic calculations and takes logical decision.
• It can compare, count, shift or other logical activities. All such calculations and comparisonsare done in this unit.
• It takes data from memory unit and return information (process date) to memory unit ifstorage requires.
Central Processing Unit (CPU)
• CU• It manages and coordinates operations of all other components of computer system. It also
performs following functions:
• It retrieves instruction or data from memory.
• It decodes instruction.
• It coordinates time sequence of instruction among various component of system.
• It determines requirement of storage and take action according to it.
• It also fetches instruction from main memory.
Bus and System Bus
• In computer architecture, a bus is a communication system that transfers data betweencomponents inside a computer, or between computers.
• This expression covers all related hardware components (wire, optical fiber, etc.) andsoftware, including communication protocols.
• Can be parallel or serial.
Bus and System Bus
Memory Unit
• Storage unit for processing data and information.
• Holds instructions and data needed for programs that are currently running
• Two types of storage:• Primary/Main storage
• Secondary storage
Classification of Main Memory
1. Random Access Memory (RAM)1. Stores current program or data.
2. Stores temporary data of current program.
3. Less space in comparison to secondary storage.
4. Volatile (data losses on power off)
5. Comparatively more expensive.
6. Fast in operation.
2. Read Only Memory (ROM)
Random-Access Memory (RAM)• Static RAM (SRAM)
• Each cell stores bit with a six-transistor circuit.
• Retains data, as long as it is kept powered.
• Relatively insensitive to disturbances such as electrical noise.
• Faster (8-16 times faster) and more expensive (8-16 times more expensive as well) than DRAM.
• Used in cache of the processor.
• Dynamic RAM (DRAM)• Each cell stores bit with a capacitor and transistor.
• Data must be refreshed every 10-100 ms.
• Sensitive to disturbances.
• Slower and cheaper than SRAM.
• Used in smartphones, tablets, laptops etc.
Read only Memory(ROM)
• ROM is used for storing programs that are PERMENTLY resident in the computerand for tables of constants that do not change in value once the production of thecomputer is completed
• The ROM portion of main memory is needed for storing an initial program calledbootstrap loader, witch is to start the computer software operating when power is turnedon
Types of Read only Memory (ROM)
PROM
PROM stands for Programmable Read Only Memory. This form of ROM is initially blank. Theuser or manufacturer can write data/program on it by using special devices. However, once theprogram or data is written in PROM chip, it cannot be changed. If there is an error in writinginstructions or data in PROM, the error cannot be erased. PROM chip becomes unusable.
EPROM
EPROM stands for Erasable Programmable Read Only Memory. This form of ROM is alsoinitially blank. The user or manufacturer can write program or data on it by using special devices.Unlike PROM, the data written in EPROM chip can be erased by using special devices andultraviolet rays. So program or data written in EPROM chip can be changed and new data canalso be added. When EPROM is in use, its contents can only be read.
EEPROM
EEPROM stands for Electrically Erasable Programmable Read Only Memory. This kind of ROMcan be written or changed with the help of electrical devices. So data stored in this type of ROMchip can be easily modified.
Secondary Memory
• A nonvolatile storage medium
• Contents retained while power is off
• Hard disk drives are most common• Records data magnetically on a circular disk
• Provides fast access to large amounts of data
• USB flash memory devices• High capacity device plugs into USB port
• Portable, reliable, and fits easily in a pocket
• e.g. Hard disk (HDD), CD, DVD, Pen Drive, Removable hard disk
Input Devices
• Accept data and instructions from the user or from another computer system
23
KeyBoard
24
Mouse
Scanner
25
Joy Stick
Light Pen
26
Web Camera
Touch Screen
27
Mike
Output Devices
Return Processed data back to the user or other computer system
28
Laser Printer29
Ink Jet Printer
Dot Matrix Printer
30
Line Printer
Speakers
31
Monitor
Classification of programming languages
• Machine or Low level language
• Assembly language
• High level language
• Note: Refer the document “Classification of Programming Languages”uploaded on blog.
Summary of characteristics of languages
Sr. No Language Characteristics
1. Machine Language 1. Machine dependent2. Uses special codes and assignment of storage address
2. Assembly Language 1. Machine dependent2. Uses mnemonics3. 1 to 1 language i.e. for assembly language instruction generated
3. High-level Language 1. Machine independent2. Uses instructions which seem English – like.3. 1 to many language i.e. for high level instruction, many machine
language generated (OS specific).
Compiler
• Compiler is a computer program (or set of programs) that transforms source code written ina programming language (the source language) into another computer language (the targetlanguage, often having a binary form known as object code). The most common reason forwanting to transform source code is to create an executable program.
• The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a lower level language (e.g., assembly language or machine code).
• If the compiled program can run on a computer whose CPU or operating system is differentfrom the one on which the compiler runs, the compiler is known as a cross-compiler.
• A program that translates from a low level language to a higher level one is a decompiler.
• A program that translates between high-level languages is usually called a source-to-sourcecompiler.
Interpreter
A translating program that translates and executes the statements in sequence
• Assembler or compiler produce machine code as output, which is then executed in a separatestep i.e. translates line by line conversion of high level language into low level programs.
• An interpreter translates a statement and then immediately executes the statement
• Interpreters can be viewed as simulators
35
Compilers
36
How does this differ from
the assembly process?
Assembler
• An assembler is a program that takes basic computer instructions (assembly language)and converts them into a pattern of bits (machine language) that the computer'sprocessor can use to perform its basic operations.
• e.g. Microprocessor 8085, 8088.
• Instruction: ADD R1, R2
• Note: Refer the document “compiler_assembler_linker_loader” uploaded onblog.
Compiler vs. Interpreter
Sr. No. Particular Compiler Interpreter
1. Scheme Compiler scans the whole program ata time and lists out error if any.
Interpreter scans the program line byline and stop scanning whenever erroroccurs.
2. Manner Compiler converts the whole sourcecode into object code at a time.
Interpreter converts the sourceprograms.
3. Source Code After compilation, source code is notrequired.
For every execution run, source isrequired.
4. Speed Execution is faster Execution is slower.
5. Object Code The object code is generated whenthe program is error free.
Generates object code for each lineimmediately if it is error free.
6. Memory Requires more memory. Requires less memory.
Operating System(OS)• Operating System is a software, which makes a computer to actually work.
• It is the software the enables all the programs we use.
• The OS organizes and controls the hardware.
• OS acts as an interface between the application programs and the machine hardware.
• Examples: Windows, Linux, Unix and Mac OS, etc.,
What OS does?
An operating system performs basic tasks such as,
• controlling and allocating memory,
• prioritizing system requests,
• controlling input and output devices,
• facilitating networking and
•managing file systems.
Structure of Operating System:
Application Programs
System Programs
Software (Operating System)
HARDWARE
Structure of Operating System:
The structure of OS consists of 4 layers:1. Hardware
Hardware consists of CPU, Main memory, I/O Devices, etc,
2. Software (Operating System)Software includes process management routines, memory management routines, I/O control routines, file management routines.
3. System programsThis layer consists of compilers, Assemblers, linker etc.
4. Application programsThis is dependent on users need. Ex. Railway reservation system, Bank databasemanagement etc.