Co 1
Co 1
Functional unit
A computer consists of five functionally independent main parts input, memory,
arithmetic logic unit (ALU), output and control unit.
Input device accepts the coded information as source program i.e. high-level language.
This is either stored in the memory or immediately used by the processor to perform the
desired operations.
The program stored in the memory determines the processing steps.
Basically, the computer converts one source program to an object program. i.e. into
machine language.
Finally, the results are sent to the outside world through output device. All of these
actions are coordinated by the control unit.
Input unit: -
The source program/high level language program/coded information/simply data is fed
to a computer through input devices keyboard is a most common type.
Whenever a key is pressed, one corresponding word or number is translated into its
equivalent binary code over a cable & fed either to memory or processor.
Example –Keyboard, Joysticks, trackballs, mouse, scanners etc are other input devices.
Memory unit: -
Its function is to store programs and data.
It is basically to two types 1. Primary memory 2. Secondary memory
Primary memory: -
Is the one exclusively associated with the processor and operates at high speed.
The memory contains a large number of semiconductors storage cells.
These are processed in a group of fixed size called word.
Programs must reside in the memory during execution. Instructions and data can be
written into the memory or read out under the control of processor.
Secondary memory: -
This type of memory is used where large amounts of data & programs have to be stored,
particularly information that is accessed infrequently.
Examples: - Magnetic disks & tapes, optical disks (ie CD-ROM’s), floppies etc.
Historical Perspective
Structure: Abacus is basically a wooden rack that has metal rods with beads
mounted on them.
Working of abacus: In the abacus, the beads were moved by the abacus
operator according to some rules to perform arithmetic calculations. In some
countries like China, Russia, and Japan, the abacus is still used by their
people.
Napier’s Bones
Napier’s Bones was a manually operated calculating device and as the name
indicates, it was invented by John Napier. In this device, he used 9 different
ivory strips (bones) marked with numbers to multiply and divide for
calculation. It was also the first machine to use the decimal point system for
calculation.
Pascaline
It is also called an Arithmetic Machine or Adding Machine. A French
mathematician-philosopher Blaise Pascal invented this between 1642 and
1644. It was the first mechanical and automatic calculator. It is invented by
Pascal to help his father, a tax accountant in his work or calculation. It could
perform addition and subtraction in quick time. It was basically a wooden box
with a series of gears and wheels. It is worked by rotating wheel like when a
wheel is rotated one revolution, it rotates the neighbouring wheel and a
series of windows is given on the top of the wheels to read the totals.
Stepped Reckoner or Leibniz wheel
A German mathematician-philosopher Gottfried Wilhelm Leibniz in 1673
developed this device by improving Pascal’s invention to develop this
machine. It was basically a digital mechanical calculator, and it was called
the stepped reckoner as it was made of fluted drums instead of gears (used
in the previous model of Pascaline).
Difference Engine
Charles Babbage who is also known as the “Father of Modern Computer”
designed the Difference Engine in the early 1820s. Difference Engine was a
mechanical computer which is capable of performing simple calculations. It
works with help of steam as it was a steam-driven calculating machine, and it
was designed to solve tables of numbers like logarithm tables.
Analytical Engine
Again in 1830 Charles Babbage developed another calculating machine
which was Analytical Engine. Analytical Engine was a mechanical computer
that used punch cards as input. It was capable of performing or solving any
mathematical problem and storing information as a permanent memory
(storage).
Tabulating Machine
Herman Hollerith, an American statistician invented this machine in the year
1890. Tabulating Machine was a mechanical tabulator that was based on
punch cards. It was capable of tabulating statistics and record or sort data or
information. This machine was used by U.S. Census in the year 1890.
Hollerith’s Tabulating Machine Company was started by Hollerith and this
company later became International Business Machine (IBM) in the year
1924.
Differential Analyzer
Differential Analyzer was the first electronic computer introduced in the year
1930 in the United States. It was basically an analog device that was
invented by Vannevar Bush. This machine consists of vacuum tubes to
switch electrical signals to perform calculations. It was capable of doing 25
calculations in a few minutes.
Mark I
In the year 1937, major changes began in the history of computers when
Howard Aiken planned to develop a machine that could perform large
calculations or calculations involving large numbers. In the year 1944, Mark I
computer was built as a partnership between IBM and Harvard. It was also
the first programmable digital computer marking a new era in the computer
world.
Generations of Computers
In this method bus architecture the processor will completely supervise and participate in
the transformation.
The information will first taken to the processor register and then to the memory such
that transfer is known as program controlled transfer.
The interconnection between i/o unit, processor and memory accomplished by two
independent system bus is known as two way bus interconnection structure.
The system bus between i/o unit and processor consist of DAB (Device address bus),
DB(Data bus),CB(Control bus).Similarly the system bus between memory processor consist
of MAB(Memory address bus),DB,CB.
The communication exists between
Memory to processor
Process to Memory
I/o to processor
processor to I/o
i/o to memory
Computer Arithmetic:
Introduction:
Arithmetic instructions in digital computers manipulate data to produce
results necessary for the solution of computational problems.
These instructions perform arithmetic calculations and are responsible for
the bulk of activity involved in processing data in a computer.
The two algorithms are similar except for the sign comparison. The procedure
to be followed for identical signs in the addition algorithm is the same as for
different signs in the subtraction algorithm, and vice versa.
Hardware Implementation:
To implement the two arithmetic operations with hardware, it is first necessary
that the two numbers be stored in registers.
i. Let A and B be two registers that hold the magnitudes of the numbers, and AS
and BS be two flip-flops that hold the corresponding signs.
ii. The result of the operation may be transferred to a third register: however, a
saving is achieved if the result is transferred into A and AS. Thus A and AS
together form an accumulator register.
The below figure shows a block diagram of the hardware for implementing the
addition and subtraction operations. It consists of registers A and B and sign
flip-flops AS and BS.
o Subtraction is done by adding A to the 2' s complement of B. The output
carry is transferred to flip-flop E, where it can be checked to determine the
relative magnitudes of the two numbers. o The add-overflow flip-flop AVF
holds the overflow bit when A and B are added.
Multiplication Algorithms:
Multiplication of two fixed-point binary numbers in signed-magnitude
representation is done with paper and pencil by a process of successive
shift and adds operations. This process is best illustrated with a
numerical example.
The sign of the product is determined from the signs of the multiplicand and
multiplier. If they are alike, the sign of the product is positive. If they are
unlike, the sign of the product is negative.
Hardware Implementation for Signed-Magnitude Data
The registers A, B and other equipment are shown in Figure (a). The
multiplier is stored in the Q register and its sign in Qs. The sequence
counter SC is initially set to a number equal to the number of bits in the
multiplier. The counter is decremented by 1 after forming each partial
product. When the content of the counter reaches zero, the product is
formed and the process stops.
Division Algorithms:
Division of two fixed-point binary numbers in signed-magnitude representation is done with
paper and pencil by a process of successive compare, shift, and subtract operations.
The division process is illustrated by a numerical example in the below figure (q).
The divisor B consists of five bits and the dividend A consists of ten bits. The five most
significant bits of the dividend are compared with the divisor. Since the 5-bit number is smaller
than B, we try again by taking the sixth most significant bits of A and compare this number with
B. The 6-bit number is greater than B, so we place a 1 for the quotient bit. The divisor is then
shifted once to the right and subtracted from the dividend.
The difference is called a partial remainder because the division could have stopped here to
obtain a quotient of 1 and a remainder equal to the partial remainder. The process is continued by
comparing a partial remainder with the divisor.
• If the partial remainder is greater than or equal to the divisor, the quotient bit is equal to 1. The
divisor is then shifted right and subtracted from the partial remainder.
• If the partial remainder is smaller than the divisor, the quotient bit is 0 and no subtraction is
needed. The divisor is shifted once to the right in any case. Note that the result gives both a
quotient and a remainder.
Hardware Implementation for Signed-Magnitude Data:
The hardware for implementing the division operation is identical to that required for
multiplication.
The divisor is stored in the B register and the double-length dividend is stored in registers A
and Q. The dividend is shifted to the left and the divisor is subtracted by adding its 2's
complement value. The information about the relative magnitude is available in E.
If E = 1, it signifies that A≥B. A quotient bit 1 is inserted into Q, and the partial remainder is
shifted to the left to repeat the process.
If E = 0, it signifies that A < B so the quotient in Qn remains a 0. The value of B is then
added to restore the partial remainder in A to its previous value. The partial remainder is shifted
to the left and the process is repeated again until all five quotient bits are formed.
Note that while the partial remainder is shifted left, the quotient bits are shifted also and after
five shifts, the quotient is in Q and the final remainder is in A.
The sign of the quotient is determined from the signs of the dividend and the divisor. If the two
signs are alike, the sign o f the quotient is plus. If they are unalike, the sign is minus. The sign of
the remainder is the same as the sign of the dividend.
Divide Overflow
The division operation may result in a quotient with an overflow. This is not a problem when
working with paper and pencil but is critical when the operation is implemented with hardware.
This is because the length of registers is finite and will not hold a number that exceeds the
standard length.
To see this, consider a system that has 5-bit registers. We use one register to hold the divisor
and two registers to hold the dividend. From the example shown in the above, we note that the
quotient will consist of six bits if the five most significant bits of the dividend constitute a number
greater than the divisor. The quotient is to be stored in a standard 5-bit register, so the overflow
bit will require one more flip-flop for storing the sixth bit.
This divide-overflow condition must be avoided in normal computer operations because the
entire quotient will be too long for transfer into a memory unit that has words of standard length,
that is, the same as the length of registers.
This condition detection must be included in either the hardware or the software of the
computer, or in a combination of the two.
When the dividend is twice as long as the divisor,
i. A divide-overflow condition occurs if the high-order half bits of the dividend constitute a
number greater than or equal to the divisor.
ii. A division by zero must be avoided. This occurs because any dividend will be greater than or
equal to a divisor which is equal to zero. Overflow condition is usually detected when a special
flip-flop is set. We will call it a divide-overflow flip-flop and label it DVF. Hardware
Algorithm:
1. The dividend is in A and Q and the divisor in B . The sign of the result is
transferred into Qs to be part of the quotient. A constant is set into the sequence counter SC to
specify the number of bits in the quotient.
2. A divide-overflow condition is tested by subtracting the divisor in B from half of
the bits of the dividend stored in A. If A ≥ B, the divide-overflow flip-flop DVF is set and the
operation is terminated prematurely. If A < B, no divide overflow occurs so the value of the
dividend is restored by adding B to A.
3. The division of the magnitudes starts by shifting the dividend in AQ to the left with
the high-order bit shifted into E. If the bit shifted into E is 1, we know that EA > B because EA
consists of a 1 followed by n-1 bits while B consists of only n -1 bits. In this case, B must be
subtracted from EA and 1 inserted into Qn for the quotient bit.
4. If the shift-left operation inserts a 0 into E, the divisor is subtracted by adding its 2's
complement value and the carry is transferred into E . If E = 1, it signifies that A ≥ B; therefore,
Qn is set to 1 . If E = 0, it signifies that A < B and the original number is restored by adding B to
A . In the latter case we leave a 0 in Qn.
This process is repeated again with registers EAQ. After n times, the quotient is
formed in register Q and the remainder is found in register A.