to - CodeDuniya.com
Download
Report
Transcript to - CodeDuniya.com
“Computing machines…it is
all about Data…
..Representation, Storage,
Processing, and
communication of Data”
1
A machine for Computational Problem Solving (i.e. computer),
What Capabilities should this machine have ?
• Well..any computational problem involves two
primary elements:
– Data (numbers, text or strings,...) used for
input, manipulation and output.
– An Algorithm (that describes the operations
(e.g. arithmetic or comparison) that must be
performed on data pertinent to the problem.2
A machine for Computational Problem Solving (i.e. computer),
What Capabilities should this machine have ?
• Thus, Our machine must have the following
capabilities:
– Representation & Storage (of both Data,
and the instructions of the Algorithm that
defines operations on data).
– Data Processing (Interpret algorithm
instructions + carry out operations defined
by these instructions on Data).
– Data input and Data output.
3
Computer Capabilities
Lets illustrate them using an example computational problem
•
Consider the problem of computing the sum of 3 numbers which are
entered via the keyboard by the user of the program: sum = x1 + x2 + x3
•
The following is a possible algorithm to solve the problem:
a) Type in (i.e. Input) the first number, second number ,
and third number storing them inside the machine.
b) Add first number to second number to produce a
sum, store sum in the machine.
c) Add the third number to sum to produce a final sum,
store sum inside the machine.
d) Output value of sum.
4
Computer Capabilities
“Information in the Computer is bits+context”
• Both Data and algorithms are encoded in the
computer using Bits,
• Think of a Bit as a code that can be either equal to
0 or 1.
• Encoding means that for each data value or
algorithm instruction you use a code consisting of
one or more bits to represent it.
• For example, Street Traffic lights is a form of
encoding for instructions to motorists (red = ‘stop’,
5
yellow = ‘slow down’, green=‘go’).
Computer Capabilities
if data and algorithms are represented using bits
Representation = encoding data using bits, and
encoding algorithms instructions using bits
Storage
= storing bits used to encode data and
algorithm instructions inside the computer.
Data Processing= For each instruction:
1) Interpreting the bits of the instruction, and
2) doing the operation specified in the instruction
(arithmetic or logic), on the bits of the data
specified in the instruction
6
Computer Capabilities
if data and algorithms are represented using bits (cnt’d)
Data Input
= converting data transferred into
the machine (say through a keyboard or mouse)
into bits (and storing these bits).
Data output
= converting bits of data into
appropriate format for transfer outside the machine
(e.g. to the screen).
7
Computer Capabilities
Transistor = a ‘bit’ of information
The transistor can be thought of as a storage location
(cell) in which you can store (write) one of two possible
symbols:
0 (if you apply current east-to-west)
1 (if you apply current west-to-east)
0 Volts
=
0 is stored
Electric current
No resistance
transistor
Power source
Transistor is said to
be storing a 0 here
5 Volts
=
1 is stored
Electric current
resistance
transistor
Power source
Transistor is said to
be storing a 1 here
8
Computer Capabilities
Transistor = a ‘bit’ of information
• Thus, a transistor circuit can store the value
of 1 bit.
• A transistor can be set to either on (1) or off
(0) by controlling the direction of the electric
current passing through it.
• Hundreds of Millions of transistors can be
packed into a small ‘compact’ unit called the
9
integrated circuit (IC) (a.k.a CHIP).