Chapter 1, Computer
Chapter 1, Computer
Computer
A computer is a programmable electronic device that accepts data and
instruction as an input from the user , executes instructions , processes
data and provides useful information as output. The electronic device is
known as hardware and the set of instruction is known as software.
Computer Hardware
Computer hardware is the collection of physical parts of a computer
system. This includes the computer case, monitor, keyboard, and mouse. It
also includes all the parts inside the computer case, such as the hard disk
drive, motherboard, video card, and many others. Computer hardware is
what you can physically touch.
Mainly computer system consists of three parts, that are the central
processing unit (CPU), Input Devices, and Output Devices. The Central
Processing Unit (CPU) is divided into two parts again: arithmetic logic unit
(ALU) and the control unit (CU).
A large amount of data is stored in the computer memory with the help of
primary and secondary storage devices. The CPU is like the heart/brain of
the computer. The user does not get the desired output, without the
necessary option taken by the CPU. The Central processing unit (CPU) is
responsible for the processing of all the instructions which are given by the
user to the computer system.
The data is entered through input devices such as the keyboard, mouse,
etc. This set of instruction is processed by the CPU after getting the input
by the user, and then the computer system produces the output. The
computer can show the output with the help of output devices to the user,
such as monitor, printer, etc.
Input Unit
Output Unit
CU (Control Unit)
MU (Memory Unit)
SOFTWARE
System Software
Application Software
Interpreter Compiler
Interpreter translates just one statement Compiler scans the entire program and
of the program at a time into machine translates the whole of it into machine
code. code at once.
An interpreter takes very less time to A compiler takes a lot of time to analyze
analyze the source code. However, the the source code. However, the overall
overall time to execute the process is time taken to execute the process is
much slower. much faster.
Compilation Process
A source code must go through several steps before it becomes an
executable program. In the first step the source code is checked for any
syntax errors. After the syntax errors are traced out a source file is passed
through a compiler which first translates high level language into object
code (A machine code not ready to be executed). A linker then links the
object code with pre-compiled library functions, thus creating an executable
program. This executable program is then loaded into the memory for
execution. General compilation process is shown in Figure below: