By pragyansharma
polavarapu
Let us explain in a very simple way the basic idea. Each “software
instruction” consists of two well
defined parts. The two parts are the OPCODE and the
OPERAND.
(1) The OPCODE means the particular arithmetic operation . It is
the electronic circuit in the ALU for
operations like (+, -
, X , / ,square,square root etc).
(2) The OPERAND . It is the arithmetic expression /numbers on
which the mathematical operation (add/subtract/multiply/divide
etc ) is to be done.
A “software instruction” involving mathematical work looks as shown
below(in an extremely simple example). The first item in the “software instruction” is OPCODE . The second
item is OPERAND.
Only after they get
translated into 01010101 code (in a millionth of second),required OPCODE circuits
(+,-, x etc )will be switched on . Then the OPERANDS will be
transmitted through the current paths to the ALU in millionth of second. Simple
examples are given below.
[add] [238 ]
[multiply ] [15 ]
[subtract] [ 1354 ]
[divide] [20 ]
THE ARITHMATIC AND LOGIC UNIT(ALU)
It is the most important part after the CPU. It is a group
of inter-connected REGISTERS and contains the highly complicated (and
once very costly) mathematical circuits.
The ALU contains the part called
ACCUMULATOR which stores the intermediate answers .The
ACCUMULATOR is like a water drum into which water is poured with a
mug and the latest interim answer is
indicated by the total number of mugs of water which
“accumulated” in the drum. As a very simple example let us take following
expression with 100 numers or even a million numbers.
6+8-5+3……
All calculations in Computer’s ACCUMULATOR
starts with a “0” as the starting number for any calculation. So the
progress in mathematical operations is as follows
0+6=6
6+8=14
14-5=9
9+3=12
and so on until the hundred or thousand or
million numbers are operated upon.The work in the computer is so
fast --(done by electron current flowing at speeds near 300,000 kilometers per
second)---that such basic mathematical operations though a million in number go
on and get completed in fraction of a second. But is really a”leisurly pace” for
the computer!
The final end answer, is conveyed to the ‘OUTPUT’ i.e
computer screen on orders from CPU. Computer never tires and never
commits mistakes. If a wrong program is given,the computer gives an error
message and stops working. Only after human operator rectifies mistake it again
starts working.
DUTIES OF IMPORTANT REGISTERS.
Each register is like a highly
trained specialist clerk. Let us
examine duties performed by some registers.
(a) INSTRUCTION REGISTER (IR) : A SOFTWARE INSTRUCTION
is first detained for a millionth of second in the IR. After
decoding it is sent to another register.
( b )MEMORY DATA REGISTER (MDR): Here the mathematical data is
temporarlily stored till CPU orders its transfer to next part. Here the “interim answer” is
temporarily stored till orders are received from CPU for its
next destination. The “FINAL ANSWER” coming from ALU is also
temporarily stored here until CPU orders it to be sent to OUTPUT(computer
screen).
( c )MEMORY ADDRESS REGISTER (MAR):
The serial numbers (DIGITAL ADDRESS) of all the
SOFTWARE INSTRUCTIONS ( similar to the house number) are maintained
here. MAR conveys serial number of next instruction to MAIN MEMORY, concerned REGISTERS/ALU
etc .This system ensures utmost speed in processing software
instructions one after another without any waiting.
( d ) PROGRAM COUNTER (PC) ---It strictly
ensures that software instructions are released as per their serial number and
conveys the information in advance to MAIN MEMORY , other REGISTERS etc .
(e) THE ARITHMATICAL AND LOGIC UNIT –It is the central
mathematical section much like the mathematics teacher. It contains several
costly mathematical and logic circuits and in importance next only to the CPU .
Its functions are simply explained above already.
A SIMPLE EXAMPLE OF WORK IN ALU
FROM A MATHEMATICAL VIEW.
The formula (equal to a software program) is
“5a+4b=k”
The input data is as
follows
Three values
of a a=24,
79,64
Three values of
b b=56, 26, 49
Answer K1 =(5x24)+(4x56)
Answer K2 =(5x79)+(4x26)
Answer K3 =(5x64)+(4x49)
Even a million sets of values of a and b are processed and
solved in a millionth of second in a similar way and in a leisurely
most perfect way .
Under instructions of CPU the REGISTERS
and ALU work. The final answer is kept temporarily in MAIN MEMORY. On receiving
instructions from CPU the final answer is sent to OUTPUT
Comments
Post a Comment