Documentos de Académico
Documentos de Profesional
Documentos de Cultura
CHAPTER I
Workstations: workstations are capable of large computation. They can be
configured based on the memory and processing needs to be stand-alone units
with processing power and graphic capabilities or they can be connected to
other computers for special activities such as email and internet access.
(ii)
Hardware: hardware means the collection of all the physical components that
constitute a computer.
Software: software is the collection of all the programs that run on the hardware
of the computer.
Firmware: firmware is the part of hardware that is permanently programmed. In a
computer that would be the ROM/BIOS. Some examples include, the software
running in your Internet firewall/router, the software running in your DVD player,
your car computer system, software running your cell phone, etc.
(i)
Input Unit:
Computers need to receive data and instruction in order to solve any problem. Therefore
we need to input the data and instructions into the computers. The input unit consists of
one or more input devices. Keyboard is the one of the most commonly used input device.
Other commonly used input devices are the mouse, CD/DVD/BLUERAY, Pen drive,
scanner etc. All the input devices perform the following functions.
# Accept the data and instructions from the outside world.
# Convert it to a form that the computer can understand.
# Supply the converted data to the computer system for further processing.
(ii)
Storage Unit:
The storage unit of the computer holds data and instructions that are entered through the
input unit, before they are processed. It preserves the intermediate and final results before
these are sent to the output devices. It also saves the data for the later use. The various
storage devices of a computer system are divided into two categories.
(a) Primary Storage: Stores and provides very fast. This memory is generally used to
hold the program being currently executed in the computer, the data being received
CHAPTER I
from the input unit, the intermediate and final results of the program. The primary
memory is temporary in nature. The data is lost, when the computer is switched off.
In order to store the data permanently, the data has to be transferred to the secondary
memory. Therefore most computers have limited primary storage capacity. For
example random-access memory (RAM) is the Primary Storage device. It is smallsized, light, but quite expensive at the same time
(b) Secondary Storage: Secondary storage is used like an archive. It stores several
programs, documents, data bases etc. The programs that you run on the computer are
first transferred to the primary memory before it is actually run. Whenever the results
are saved, again they get stored in the secondary memory. Some of the commonly
used secondary memory devices are Hard disk, CD, etc.
(iii)
Memory Size:
All digital computers use the binary system, i.e. 0s and 1s. The set of 8 bits is called a
byte. Byte is the space occupied in the memory. A character occupies 1 byte space. A
numeric occupies 2 byte space. Bit means in short for binary digit, the smallest unit of
information on a machine.
1 bit = a 1 or 0 (b)
8 bits = 1 byte (B)
1024 bytes = 1 Kilobyte (KB)
1024 Kilobytes = 1 Megabyte (MB)
1 Megabyte = 8192 kilobits (kb)
1024 Megabytes = 1 Gigabyte (GB)
1024 Gigabytes = 1 Terabyte (TB)
The terms 32-bit and 64-bit refer to the way a computer's processor (also called a CPU),
handles information. The 64-bit version of Windows handles large amounts of random
access memory (RAM) more effectively than a 32-bit system.
(iv)
Output Unit:
The output unit of a computer provides the information and results of a computation to
outside world. Printers, monitor are the commonly used output devices.
(v)
(vi)
Control Unit:
The control unit is the circuitry that controls the flow of information through the
processor, and coordinates the activities of the other units within it. In a way, it is the
"brain within the brain", as it controls what happens inside the processor. It controls all
other units in the computer. The control unit instructs the input unit, where to store the
data after receiving it from the user. It controls the flow of data and instructions from the
storage unit to ALU. It also controls the flow of results from the ALU to the storage unit.
The control unit is generally referred as the central nervous system of the computer that
control and synchronizes its working.
(vii)
CHAPTER I
The control unit and ALU of the computer are together known as the Central Processing
Unit (CPU). The CPU is like brain performs the following functions:
It performs all calculations.
It takes all decisions.
It controls all units of the computer.
Processor Manufacturers
* American Micro Devices (AMD)
* Intel
* IBM
* Motorola
* Cyrix
* Texas Instruments
3.
Software: Software consists of program written to support the basic operations of the
system and program written to carry out an application.
(iii)
System software: the software that controls the execution of an application program is
called system software. The major system software components are operating system and
language system.
(a) Operating system: it makes the system facilities available to the application programs
and controls their use.
(b) Language system: language systems are classified as high-level and low-level
languages.
High-level language: languages that are reasonably machine independent and people
oriented are called high-level language.
Low-level language: Assembly language and machine oriented languages are called
low-level language. Low-level languages can be converted to machine code without
using a compiler or interpreter, and the resulting code runs directly on the processor.
A program written in a low-level language can be made to run very fast, and with a
very small memory footprint;
(iv)
Compilers: compilers are the language system that translates programs written in highlevel language such as C, C++, java etc. into machine code which the hardware can
interpret and execute directly.
(v)
Debug: In computers, debugging is the process of locating and fixing or bypassing bugs
(errors) in computer program code.
CHAPTER I
Solving a problem on a computer requires a thorough understanding and analysis of the problem
and data. Once the problem has been analyzed, the detailed design of a solution can be developed.
One of the steps in designing and developing a computerized solution to a problem is to develop
an algorithm to solve the problem.
5. Concept of an algorithm
Definition of algorithm: an algorithm is a procedure consisting of a finite number of precisely
defined steps for solving a problem. Each step of an algorithm must be an unambiguous (Having
or exhibiting a single clearly defined meaning) instruction which, when written in a computer
language, can be executed by a computer.
Example: the following example shows the algorithm to solve a design problem.
Calculate in kg, total amount of steel required to build a pipeline to carry water.
1.
2.
3.
4.
5.
6.
Input/output instruction: to input data into the computer and output answers of it.
assignment instruction: to rearrange the data.
Arithmetic instruction: to perform calculations
Control instruction: to control selection & repetition of actions
Logic instructions: to help the computer make choices
(i)
Input/output instruction
Input refers to data sent to the computer processor from a file on an automatic storage
device or from an outside source (keyboard, external device).
Output refers to the datra sent out from the computer processor to automatic storage
device or to an outside device (printer, monitor).
(ii)
Assignment instruction
Assignment refers to the copying of data from one memory location to another. For
example
a = b;
in C language
does not mean that a and b are the same thing. Its meaning is the value contained in the
memory location named b is copied into the memory location named a. after this
assignment instruction whatever the memory location a contains, memory location b will
also contain the same value.
(iii)
Arithmetic instruction
Arithmetic instruction refers to the basic arithmetic operation of addition, subtraction,
multiplication, division, remainder and exponentiation and assigning the answer to a
variable.
a = 2.5 + 6.5 / 3.25;
(iv)
Control instruction
CHAPTER I
Control instructions are used to switch from one set of instruction to another set of
instruction depending upon the logical comparison of data values. For example, the
computer might choose between addition or subtraction depending on whether a number
is + or not.
if ( x > o)
z = x + 5;
else
z = x - 5;
MATLAB m-file
%this program adds first integer value
%assignment instruction
total = 0;
%assignment instruction
while N > j
%control instruction
total = total + j;
j = j + 1;
end
%arithmetic instruction
%arithmetic instruction
%control assignment
______________________________________________________________
C program
//PROGRAM TO DETERMINE THE SUM OF FIRST INTEGER
#include <stdio.h>
//MODULE OF SYSTEM LIBRARY
#include <math.h>
int N;
int j, total;
//ASSIGNING VARIABLES
int main()
{
j = 1;
total = 0;
printf("PLEASE ENTER A VALUE=");
scanf("%d", &N);
//ASSIGNMNET INSTRUCTION
while (N > j)
{
total = total + j;
j = j + 1;
//OUTPUT INSTRUCTION
//READING THE INPUT DATA & STORING
//IT IN MEMORY LOCATION
//CONDITIONS OF LOOPING
}
printf("THE SUM IS=%d\n", total);
return 0;
//ARITHMATHICAL INSTRUCTION
//OUTPUT INSTRUCTION
//END OF PROGRAM
}________________________________________________________________
CHAPTER I
7. Flowchart
A flowchart uses standard symbols to show different operations and order of execution of the
steps of the algorithm. Lines and arrows are used to show the flow of control.
Start
Input N
N>j?
False
True
total = total + 1
j =j + 1
total = total + j
Print total
Input/outputbox: this is a parallelogram symbole with one control into it and one leading out, used to
represent input/output statemnt.
CHAPTER I
Input/output
Decesion box: a diamond shaped symbole used for the comparison of quantiites for equality.
False
Decision
True
Connector: A small circle is used as a connector symbol when two flow lines are to be coming
together.
Flow lines: it is used to connect process box and decision box symbols in the order of the logic and
control flow of the program.
CHAPTER I
When a program finally links correctly, it is executed using input data and providing output data.
Demo: Program executing in MATLAB m-file and in C
9. Introduction to string, float, and types of float, integer, long & short integer
Variables
A variable is an entity that may change. In any program we typically do lots of calculations.
The results of these calculations are stored in computers memory. Like human memory the
computer memory also consists of millions of cells. The calculated values are stored in these
memory cells. To make the retrieval and usage of these values easy these memory cells (also
called memory locations) are given names. These names are called variables. Since the value
stored in each location may change, the names given to these locations are called variable.
Variables Type (i) string, integer, float, long integer, short integer
String: Strings are sequences of characters
Float number: real numbers are also known as floating-point numbers. The numbers 5.5, 8.3,
and -12.6 are all floating point numbers.
Integer: Integer numbers have no fractional part or decimal point. Numbers such as 1, 87,
and -222 are integers. The number 8.3 is not an integer because it contains a decimal point.
Assigning long integer means we wish to allocate extra storage for the integer. If we are going
to use small numbers and wish to reduce storage, we use short integer.
CHAPTER I