components of a computer.ppt
DESCRIPTION
computerTRANSCRIPT
11
Components of a Components of a ComputerComputer
22
Principles of operation of a Principles of operation of a Digital ComputerDigital Computer
Receives the data and instructionsReceives the data and instructions Processes the data as per the instructionsProcesses the data as per the instructions Output the result Output the result i.e., i.e., informationinformation
Process
IPO-CycleInput Output
Instructions
33
Functional components of a Functional components of a computer systemcomputer system
A computer system has five basic functional units A computer system has five basic functional units which are listed belowwhich are listed below
Input UnitInput Unit Output UnitOutput Unit Control Unit Control Unit Memory UnitMemory Unit Arithmetic Logic Unit Arithmetic Logic Unit
Central Processing UnitCentral Processing Unit
44
Flow diagram of a CPUFlow diagram of a CPU
Input unit Output unit
Control Unit
ALU
Memory unit
E.g.. Keyboard E.g.. Monitor/Printer
Processor
55
Controls the overall operation of the comp sysControls the overall operation of the comp sys Heart of the comp sysHeart of the comp sys Directs all other units to operate in a proper Directs all other units to operate in a proper
wayway Co-ordinates various operations performedCo-ordinates various operations performed
Control Unit
66
Performs Arithmetic and Logic operations on Performs Arithmetic and Logic operations on datadata
Consists of Circuits and RegistersConsists of Circuits and Registers +, -, *, /+, -, *, / <, >, <=, >=<, >, <=, >= AddersAdders
Arithmetic and Logic Unit
77
Memory UnitMemory
Main memory/Primary Memory
Auxiliary Memory/Secondary Memory
Magnetic CoreMemory
Semi-conductorMemory
RAM ROM
Dynamic Static PROM EPROM EEPROM
88
Consists thousands of tiny doughnut shaped ferrite cores Consists thousands of tiny doughnut shaped ferrite cores arranged in array of 64*64.arranged in array of 64*64.
Electric current passing through the wires can magnetise the Electric current passing through the wires can magnetise the cores in 2 directions.cores in 2 directions.
Fairly fast, capable of transferring 2.4 million characters per Fairly fast, capable of transferring 2.4 million characters per secondsecond
Memory access time is about nanosecondMemory access time is about nanosecond Non-VolatileNon-Volatile Relatively large and heavyRelatively large and heavy
Magnetic Core Memory/Ferrite Core Memory
99
Based on the principle of storage chipsBased on the principle of storage chips A very thin silicon chips contains a no of small A very thin silicon chips contains a no of small
storage cells that can be hold data.storage cells that can be hold data. Faster and more expensive semi conductor chips Faster and more expensive semi conductor chips Volatile Volatile Faster than magnetic core memoryFaster than magnetic core memory Relatively small and lightRelatively small and light
Semi - Conductor Memory
1010
Needs constant supply Needs constant supply of electrical pulseof electrical pulse
Faster Faster Refresh rateRefresh rate
Requires voltageRequires voltage Refreshing is not Refreshing is not
requiredrequired slowerslower
Dynamic RAM Static RAM
1111
PROMPROM EPROMEPROM EEPROMEEPROM
ROM
Measurement of Memory
8 bits 1 Byte1024 b 1 Kilo Byte1024 kb 1 Mega Byte1024 mb 1 Giga Byte1024 gb 1 Tera Byte
1212
Computer LanguagesComputer Languages
Low Level Middle Level High Level
Binary Language Assembly Language
C
C++
COBOL
JAVA
1313
AssemblerAssembler Linker and LoaderLinker and Loader CompilerCompiler InterpreterInterpreter
Language Processors
compilerscompilers
A A program that translates that translates source code into into object code. The compiler derives its name from the . The compiler derives its name from the way it works, looking at the entire piece of source way it works, looking at the entire piece of source code and collecting and reorganizing the code and collecting and reorganizing the instructions. . Thus, a compiler differs from an Thus, a compiler differs from an interpreter, which , which analyzes and analyzes and executes each line of source code in each line of source code in succession, without looking at the entire program. succession, without looking at the entire program. The advantage of interpreters is that they can The advantage of interpreters is that they can execute a program immediately. Compilers require execute a program immediately. Compilers require some time before an executable program emerges. some time before an executable program emerges. However, programs produced by compilers However, programs produced by compilers run much much faster than the same programs executed by an faster than the same programs executed by an interpreter. interpreter.
1414
Every Every high-level programming language (except (except strictly interpretive languages) comes with a strictly interpretive languages) comes with a compiler. In effect, the compiler is the compiler. In effect, the compiler is the language, , because it defines which instructions are because it defines which instructions are acceptable. acceptable.
Because compilers translate source code into Because compilers translate source code into object code, which is unique for each type of object code, which is unique for each type of computer, many compilers are available for the , many compilers are available for the same language. For example, there is a same language. For example, there is a FORTRAN compiler for compiler for PCs and another for Apple Macintosh and another for Apple Macintosh computers. In addition, the compiler industry is computers. In addition, the compiler industry is quite competitive, so there are actually many quite competitive, so there are actually many compilers for each language on each type of compilers for each language on each type of computer. More than a dozen companies develop computer. More than a dozen companies develop and sell C compilers for the PC. and sell C compilers for the PC.
1616
Assembler Assembler
the assembly language, a computer the assembly language, a computer program to translate between lower-program to translate between lower-level representations of computer level representations of computer programs; it converts basic computer programs; it converts basic computer instructions into a pattern of bits instructions into a pattern of bits which can be easily understood by a which can be easily understood by a computer and the processor can use computer and the processor can use it to perform its basic operationsit to perform its basic operations
1717
AssemblersAssemblers • • Assemblers need toAssemblers need to
– – translate assembly instructions and pseudo-translate assembly instructions and pseudo-instructions into machine instructionsinstructions into machine instructions
– – Convert decimal numbers, etc. specified byConvert decimal numbers, etc. specified by
programmer into binaryprogrammer into binary
• • Typically, assemblers make two passes over theTypically, assemblers make two passes over the
assembly fileassembly file – – First pass: reads each line and records First pass: reads each line and records labels in labels in
a symbol tablea symbol table
– – Second pass: use info in symbol table to Second pass: use info in symbol table to produce actual machine code for each lineproduce actual machine code for each line
1818
Linker and loadersLinker and loaders
LinkerLinker
• • Tool that merges the object files produced by Tool that merges the object files produced by separate separate compilation or assembly and creates an compilation or assembly and creates an executable fileexecutable file
Three tasksThree tasks
– – Searches the program to find library routines used bySearches the program to find library routines used by
program, e.g. print f(), math routines,…program, e.g. print f(), math routines,…
– – Determines the memory locations that code from eachDetermines the memory locations that code from each
module will occupy and relocates its instructions bymodule will occupy and relocates its instructions by
adjusting absolute referencesadjusting absolute references
––Resolves references among filesResolves references among files
1919
LoaderLoader
• • Part of the OS that brings an executable file Part of the OS that brings an executable file residing on disk into memory and starts it runningresiding on disk into memory and starts it running
• • StepsSteps
– – Read executable file’s header to determine the Read executable file’s header to determine the size ofsize of
text and data segmentstext and data segments
– – Create a new address space for the programCreate a new address space for the program
– – Copies instructions and data into address spaceCopies instructions and data into address space
– – Copies arguments passed to the programCopies arguments passed to the program
– – Initializes the machine registersInitializes the machine registers
– – Jumps to a startup routine that copies the Jumps to a startup routine that copies the program’sprogram’s
2020
InterpreterInterpreter An interpreter translates high-level instructions into an An interpreter translates high-level instructions into an
intermediate form, which it then executes. intermediate form, which it then executes. In contrast, a compiler translates high-level instructions directly In contrast, a compiler translates high-level instructions directly
into machine language. into machine language. Compiled programs generally run faster than interpreted Compiled programs generally run faster than interpreted
programs. The advantage of an interpreter, however, is that it programs. The advantage of an interpreter, however, is that it does not need to go through the compilation stage during which does not need to go through the compilation stage during which machine instructions are generated. machine instructions are generated.
This process can be time-consuming if the program is long. The This process can be time-consuming if the program is long. The interpreter, on the other hand, can immediately execute high-level interpreter, on the other hand, can immediately execute high-level programs.programs.
For this reason, interpreters are sometimes used during the For this reason, interpreters are sometimes used during the development of a program, when a programmer wants to add development of a program, when a programmer wants to add small sections at a time and test them quickly. small sections at a time and test them quickly.
In addition, interpreters are often used in education because they In addition, interpreters are often used in education because they allow students to program interactively. allow students to program interactively.
2121