



































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This lecture is part of lecture series on Information Technology course. This lecture includes: Arithmatic Operations, Basic Arithmetic Operations, Addition, Subtraction, Multiplication, Division, Signed Magnitude, Signed 1's Complement, Signed 2's Complement, Multiplication Algorithms, Hardware Algorithm, Division Algorithm
Typology: Slides
1 / 43
This page cannot be seen from the preview
Don't miss anything!
INTRODUCTION Arithmetic Instructions in digital computers manipulate data toproduce results necessary for the of activity solution ofcomputational problems. These instructions perform arithmeticcalculations and are responsible for the bulk of activity involved inprocessing data in a computer. The four basic arithmaticoperations are addition,subtracton,multiplication,division. Fromthese basic operations, it is possible to formulate other arithmaticfunctions and solve scientific problems by means of numericalanalysis methods. An arithmetic processor is the part of a processor unit that execute arithmatic operations.
ADDMagnitu
des
SUBTRACT Magnitudes
A > B
A < B
A = B
(+A) + (+B)
+ (A + B)
(+A) + (-B)
+ (A – B )
- (B – A )
+ (A – B )
(-A) + (+B)
- (A – B )
+ (B – A )
+ (A – B )
(-A) + (-B)
- ( A + B)
(+A) - (+B)
+ (A – B )
- (B – A )
+ (A – B )
(+A) - (-B)
+ (A + B)
(-A) - (+B)
- ( A + B)
(-A) - (-B)
- (A – B )
+ (B – A )
+ (A – B )
magnitudes when theresult is the sign ofboth operands:
+
0 011
+ +
0 010
+
0 101
Example of adding two
magnitudes when theresult is the sign of thelarger magnitude: Example of adding two
magnitudes when theresult is the sign of thelarger magnitude:
- +2)
- 1
- +2)
- 1
first necessary that the two numbers be stored in registers. Let Aand b to registers that hold the magnitude of the numbers , andAs and Bs be two flip – flop that hold the corresponding sings .the result of the operation may be transferred to a third registers :however , a saving Is achived if the result is transferred Into A andAs. Thus A and As together form and accumulator registers .Consider now the hardware implementation of the algorithmabove. first, a parallel – adder is needed to perform themirooperation A + B. second , comparator circuit is needed toestablish if A>B,
X=B,
A<B. Third , two parallel-subtractor
needed to perform the microoperations A – B and B – A. Thesign relationship can be determined from an excellucive and ORgate with As and Bs as inputs. This procedure requires amagnitude comparator , addeFirst , we know that
require less r and two subtractor. however a different
procedure can be less equipment. foundFirst we know thatsubtraction can be accomplished by mean of complimentand add. Second thee result of a compresion can bedetermined for the end carry after the subtraction. Carefullinvestigation of alternatives reveals that the use of 2’scompliment for subtraction and compression is an efficentprocedure that require only an adder and a complementer.Fig. show a block diagram of hardware for implementingthe addition and subtraction operation, It consist ofregisters A and B sign flip – flops As and Bs. Subtraction isdone 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 determined the relative magnitude of twonumbers.
The addition of two number in signed-2,s
compliment from consist of adding the numbers with thesign bit treated the other bits of the numbers. A carry – out ofthe sign –bit position is discarded .The consist of first takingthe 2’scompliment of the subtrahend and then adding it to theminuend. When two numbers ofn degits each are added andthe sum occupies n+1 digits, we say that an overflow can bededicated by inspecting the last two carries out of theaddition. when the two carries are applied to an exclucive- orgate , the out of the addition. When the two carries areapplied to an exclusive - Or gate , overflow is detected whenthe output of the gate is equal to 1. The register configurationfor the hardware implementation is shown in figure. This isthe same configuration as in fig except that the sign bits arenot seprated. From the rest of the registrators. We name theA register AC (accumulator) and the B register BR.