Unit7_CA
Unit7_CA
Arithmetic
Computer Arithmetic
• Data is manipulated by using the arithmetic instructions in digital computers.
• Data is manipulated to produce results necessary to give solution for the
computation problems.
• The Addition, subtraction, multiplication and division are the four basic
arithmetic operations.
• If we want then we can derive other operations by using these four operations.
• To execute arithmetic operations there is a separate section called arithmetic
processing unit in central processing unit.
• The arithmetic instructions are performed generally on binary or decimal data.
Fixed-point numbers are used to represent integers or fractions.
• We can have signed or unsigned negative numbers. Fixed-point addition is the
simplest arithmetic operation
• If we want to solve a problem then we use a sequence of well-defined steps.
• These steps are collectively called algorithm.
• To solve various problems we give algorithms. In order to solve the
computational problems, arithmetic instructions are used in digital
computers that manipulate data.
• These instructions perform arithmetic calculations. And these instructions
perform a great activity in processing data in a digital computer.
• As we already stated that with the four basic arithmetic operations addition,
subtraction, multiplication and division, it is possible to derive other
arithmetic operations and solve scientific problems by means of numerical
analysis methods.
• A processor has an arithmetic processor(as a sub part of it) that executes
arithmetic operations.
• The data type, assumed to reside in processor, registers during the execution
of an arithmetic instruction.
• Negative numbers may be in a signed magnitude or signed complement
representation.
• There are three ways of representing negative fixed point - binary numbers
signed magnitude, signed 1‟s complement or signed 2‟s complement.
• Most computers use the signed magnitude representation for the mantissa
• In this unit we will see
• 1. Fixed-point binary data in signed magnitude representation
• 2. Fixed-point binary data in signed 2’s complement representation
• 3. Floating point binary data
• 4. Binary Coded Decimal data
Addition and Subtraction with signed magnitude data
Qn=1 00000
ADD A,B 10111
0 10111 10011
Qn=1 01011
ADD A,B 10111
1 00010 11001
• M= 0 Adder AC+BR
• M=1 Complementor and adder
AC+BR’+1 = AC-BR
M
Multiplicand=-9 = (10111)
Multiplier=-13 = (10011)
Qn Qn+1 BR=10111 AC Qr (multiplier Qn+1 SC
BR’+1 = 01001
1 0 Intial 00000 10011 0 5
01001
Working of Booth’s Multiplication Algorithm
1.Set the Multiplicand and Multiplier binary bits as M and Q,
respectively.
2.Initially, we set the AC and Qn + 1 registers value to 0.
3.SC represents the number of Multiplier bits (Q), and it is a sequence
counter that is continuously decremented till equal to the number of
bits (n) or reached to 0.
4.A Qn represents the last bit of the Q, and the Qn+1 shows the
incremented bit of Qn by 1.
1.On each cycle of the booth algorithm, Qn and Qn + 1 bits will be
checked on the following parameters as follows:
1. When two bits Qn and Qn + 1 are 00 or 11, we simply perform the arithmetic
shift right operation (ashr) to the partial product AC. And the bits of Qn and
Qn + 1 is incremented by 1 bit.
2. If the bits of Qn and Qn + 1 is shows to 01, the multiplicand bits (M) will be
added to the AC (Accumulator register). After that, we perform the right shift
operation to the AC and QR bits by 1.
3. If the bits of Qn and Qn + 1 is shows to 10, the multiplicand bits (M) will be
subtracted from the AC (Accumulator register). After that, we perform the
right shift operation to the AC and QR bits by 1.
1.The operation continuously works till we reached n - 1 bit in the booth
algorithm.
2.Results of the Multiplication binary bits will be stored in the AC and
QR registers.
1. RSC (Right Shift Circular)
It shifts the right-most bit of the binary number, and then it is added to the
beginning of the binary bits.
Q[0]=0 And
00011 00001 0110
restore A