Unit 1 Part 1 Basics of Computer
Unit 1 Part 1 Basics of Computer
A Central University
CSS-101:Fundamentals of
Computing
Mr. Hannan Mansoor
Department of Computer Engineering
2 Unit 1: BASICS OF COMPUTERS
´ Computer
´ is an advanced electronic device
that takes
´ raw data as an input from the user
and
´ processes it under the control of a
set of instructions (called
program),
´ produces a result (output), and
´ stores data for future use.
´ It was a manually-operated
calculating device which was
invented by John Napier (1550-1617)
of Merchiston (U.K.).
´ German mathematician-philosopher
Gottfried Wilhelm Leibnitz in 1673
improved Pascal's invention to
develop this machine.
1. Input:
´ Takes Data as input.
2. Processing:
´ Processing of Data and converts it into useful information.
3. Storage:
´ Stores the data/instructions in its memory and uses them according to the required.
4. Output:
´ Generates the output for the user.
5. Control:
´ control and coordinate the above four steps.
´ High Speed
´ Accuracy
´ Storage Capability
´ Diligence
´ Versatility
´ Reliability
´ Automation
´ Reduction in Paper Work and Cost
CPU
Control Unit
´ It is the process of entering raw data, instructions and information into the
computer.
´ This unit creates a link between the user and the computer.
´ The input devices translate the information into a form understandable by the
computer.
2. Control Unit:
´ This unit controls the operations of all parts of the computer but does not carry out any
actual data processing operations.
´ It manages and coordinates all the units of the computer.
´ It obtains the instructions from the memory, interprets them, and directs the operation of
the computer.
´ It communicates with Input/Output devices for transfer of data or results from storage.
´ It does not process or store data.
´ The computer has primary memory and secondary storage to store data and
instructions.
´ It stores the data before sending it to CPU for processing and also stores the
processed data before displaying it as output.
´ It is the process of presenting the processed data through output devices like
monitor, printer and speakers.
´ Output devices translate the computer's output into a form understandable by the
users.
´ The output device displays the result of the processing of raw data that is entered
in the computer through an input device.
´ There are a number of output devices that display output in different ways such as
text, images, hard copies, and audio or video.
´ Some of the popular output devices are:
´ Monitor:
´ CRT Monitor
´ LCD Monitor
´ LED Monitor
´ Plasma Monitor
´ Line printers
´ Drum printers
´ Chain printers
´ Non-impact printers
´ Laser printers
´ Inkjet printers
´ Projector
´ The memory is divided into large number of small parts called cells. Each location
or cell has a unique address
´ Register memory
´ Cache memory
´ Primary memory
´ Secondary memory
´ Cache memory is used to reduce the average time to access data from the Main
memory.
´ The cache is a smaller and faster memory which stores copies of the data from
frequently used main memory locations.
´ There are various different independent caches in a CPU, which store instructions
and data.
https://www.geeksforgeeks.org/cache-memory-in-computer-organization/
35
´ It is a volatile memory.
´ It means it does not store data or instructions permanently.
´ When you switch on the computer the data and instructions from the hard disk are stored in RAM.
´ The word static indicates that the memory retains its contents as long as power is
being supplied.
´ However, data is lost when the power gets down due to volatile nature. SRAM
chips use a matrix of 6-transistors and no capacitors.
´ Transistors do not require power to prevent leakage, so SRAM need not be
refreshed on a regular basis.
´ Long life
´ No need to refresh
´ Faster
´ Used as cache memory
´ Large size
´ Expensive
´ DRAM, unlike SRAM, must be continually refreshed in order to maintain the data.
This is done by placing the memory on a refresh circuit that rewrites the data
several hundred times per second. DRAM is used for most system memory as it is
cheap and small. All DRAMs are made up of memory cells, which are composed of
one capacitor and one transistor.
´ It is a non-volatile memory.
´ It means it does not lose its data or programs that are written on it at the time of
manufacture.
´ So it is a permanent memory that contains all important data and instructions
needed to perform important tasks like the boot process.
´ ROM stands for Read Only Memory.
´ The memory from which we can only read but cannot write on it.
´ A ROM stores such instructions that are required to start a computer. This
operation is referred to as bootstrap.
´ ROM chips are not only used in the computer but also in other electronic items like
washing machine and microwave oven
´ The secondary storage devices which are built into the computer or connected to
the computer are known as a secondary memory of the computer.
´ It is also known as external memory or auxiliary storage.
´ The secondary memory is accessed indirectly via input/output operations.
´ It is non-volatile, so permanently stores the data even when the computer is turned
off or until this data is overwritten or deleted.
´ The CPU can't directly access the secondary memory.
´ First, the secondary memory data is transferred to primary memory then the CPU
can access it.
´ Hard Disk
´ Solid-state Drive
´ Pen drive
´ Compact Disk (CD)
´ DVD
´ Byte: It is the fundamental unit to measure data. It contains 8 bits or is equal to 8 bits. Thus a byte can
represent 2! or 256 values.
´ This extra memory is actually called virtual memory and it is a section of a hard
disk that's set up to emulate the computer's RAM.
´ The main visible advantage of this scheme is that programs can be larger than
physical memory. Virtual memory serves two purposes.
48 1. The compiler scans the whole program in one go. Translates the program one statement at a time.
As it scans the code in one go, the errors (if any) are shown Considering it scans code one line at a time, errors are shown
2.
at the end together. line by line.
Due to interpreters being slow in executing the object code, it is
3. The main advantage of compilers is its execution time.
preferred less.
It does not convert source code into object code instead it
4. It converts the source code into object code.
scans it line by line
5 It does not require source code for later execution. It requires source code for later execution.
Execution of the program takes place only after the whole Execution of the program happens after every line is checked
6
program is compiled. or evaluated.
7 The machine code is stored in the disk storage. Machine code is nowhere stored.
Compilers more often take a large amount of time for In comparison, Interpreters take less time for analyzing the
8
analyzing the source code. source code.
9. It is more efficient. It is less efficient.
10. CPU utilization is more. CPU utilization is less.
C, C++, C#, etc are programming languages that are Python, Ruby, Perl, SNOBOL, MATLAB, etc are programming
Eg.
compiler-based. languages that are interpreter-based.
Department of Computer Engineering, JMI CS201
Compiler Interpreter
49
A compiler is a program that converts the entire source
code of a programming language into executable machine An interpreter takes a source program and runs it line by
code for a CPU. line, translating each line as it comes to it
The compiler requires a lot of memory for generating It requires less memory than a compiler because no object
object codes. code is generated.
For Security purpose compiler is more useful. The interpreter is a little vulnerable in case of security.
50 1.
It converts low-level language to the machine It converts high-level language to the machine
language. language.
The program for an Assembler is written for The program for an Interpreter is written for
2.
particular hardware. particular language.
It is one to one i.e. one instruction translates to It is one to many i.e. one instruction translates
3.
only one instruction. to many instruction.
4. It translates entire program before running. It translates program instructions line by line.
Errors are displayed before program is Errors are displayed for the every interpreted
5.
running. instruction (if any).
It is used only one time to create an It is used everytime when the program is
6.
executable file. running.
7. Requirement of memory is less. Requirement of memory is more.
Low level languages are used to write the system While high level languages are used to write the
software. application software.
System software runs when the system is turned on While application software runs as per the user’s
and stop when the system is turned off. request.
It requires more space and more power on the computer due to its It requires less space and less power due to its smaller size
5. Space
bigger size as compared to utility software. as compared to application software.
Thank You