SlideShare a Scribd company logo
1 of 13
COMPUTER ORGANIZATION AND ARCHITECTURE
MODULE-3 PART TWO
- LIPSA SUBHADARSHINI
Subject Code- BC 2007
No. of Credits- 4
BCA 3rd Semester
1
CONTENT
• Computer Arithmetic
• Multiplication Algorithms for fixed point numbers
• Division Algorithms for fixed point numbers
2
MULTIPLICATION ALGORITHM
• Multiplication of two fixed point binary number in signed magnitude representation is done with process
of successive shift and add operation.
• In the multiplication process we are considering successive bits of the multiplier, least significant bit first.
If the multiplier bit is 1, the multiplicand is copied down else 0’s are copied down.
• The numbers copied down in successive lines are shifted one position to the left from the previous
number.
Finally numbers are added and their sum form the product.
• The sign of the product is determined from the sign of the multiplicand and multiplier. If they are alike,
sign of the product is positive else negative.
3
MULTIPLICATION ALGORITHM
Hardware Implementation
4
MULTIPLICATION ALGORITHM
• Registers:
Two Registers B and Q are used to store multiplicand and multiplier respectively.
Register A is used to store partial product during multiplication.
Sequence Counter register (SC) is used to store number of bits in the multiplier.
• Flip Flop:
To store sign bit of registers we require three flip flops (A sign, B sign and Q sign).
Flip flop E is used to store carry bit generated during partial product addition.
• Complement and Parallel adder:
This hardware unit is used in calculating partial product i.e, perform addition required.
Flowchart of Multiplication
• Initially multiplicand is stored in B register and multiplier is stored in Q register.
• Sign of registers B (Bs) and Q (Qs) are compared using XOR functionality (i.e., if both the signs are alike,
output of XOR operation is 0 unless 1) and output stored in As (sign of A register).Note: Initially 0 is
assigned to register A and E flip flop. Sequence counter is initialized with value n, n is the number of bits
in the Multiplier.
5
MULTIPLICATION ALGORITHM
6
MULTIPLICATION ALGORITHM
• Now least significant bit of multiplier is checked. If it is 1 add the content of register A with Multiplicand
(register B) and result is assigned in A register with carry bit in flip flop E. Content of E A Q is shifted to
right by one position, i.e., content of E is shifted to most significant bit (MSB) of A and least significant bit
of A is shifted to most significant bit of Q.
• If Qn = 0, only shift right operation on content of E A Q is performed in a similar fashion.
• Content of Sequence counter is decremented by 1.
• Check the content of Sequence counter (SC), if it is 0, end the process and the final product is present in
register A and Q, else repeat the process.
Example:
Multiplicand = 10111
Multiplier = 10011
7
MULTIPLICATION ALGORITHM
8
DIVISION ALGORITHM
• The Division of two fixed-point binary numbers in the signed-magnitude representation is done by the
cycle of successive compare, shift, and subtract operations.
• The binary division is easier than the decimal division because the quotient digit is either 0 or 1. Also,
there is no need to estimate how many times the dividend or partial remainders adjust to the divisor.
9
DIVISION ALGORITHM
HARDWARE IMPLEMENTATION
• The hardware implementation in the division operation is identical to that required for multiplication and consists of
the following components –
• Here, Registers B is used to store divisor, and the double-length dividend is stored in registers A and Q
• The information for the relative magnitude is given in E.
• A sequence Counter register (SC) is used to store the number of bits in the dividend.
10
DIVISION ALGORITHM
FLOWCHART
11
DIVISION ALGORITHM
• Initially, the dividend is in A & Q and the divisor is in B.
• The sign of the result is transferred into Q, to be part of the quotient. Then a constant is set into the SC to
specify the number of bits in the quotient.
• Since an operand must be saved with its sign, one bit of the word will be inhabited by the sign, and the
magnitude will be composed of n -1 bits.
• The condition of divide-overflow is checked by subtracting the divisor in B from the half of the bits of the
dividend stored in A. If A ≥ B, DVF is set and the operation is terminated before time. If A < B, no
overflow condition occurs and so the value of the dividend is reinstated by adding B to A.
• The division of the magnitudes starts with the dividend in AQ to left in the high-order bit shifted into E.
(Note – If shifted a bit into E is equal to 1, and we know that EA > B as EA comprises a 1 followed by n -1
bits whereas B comprises only n -1 bits). In this case, B must be subtracted from EA, and 1 should insert
into Q, for the quotient bit.
• If the shift-left operation (shl) inserts a 0 into E, the divisor is subtracted by adding its 2’s complement
value and the carry is moved into E. If E = 1, it means that A ≥ B; thus, Q, is set to 1. If E = 0, it means that
A < B, and the original number is reimposed by adding B into A.
• Now, this process is repeated with register A containing the partial remainder.
12
DIVISION ALGORITHM
Example of a binary division using digital
hardware:
Divisor B = 10001, Dividend A = 0111000000
Final Remainder: 00110
Final Quotient: 11010
Now, what if the divisor is greater than or equal to the
dividend. In this process, division overflow occurs. EA
stores the value of A+B, there is no application of Q
here as if the divisor is equal to dividend then Q might
1 and remainder is 0, else in every other condition the
value of quotient 1 and remainder equals to the
dividend.
13

More Related Content

Similar to Module 3 of computer organization and architecture

Arithmetic Unit Addition Subtraction Multiplication and Division
Arithmetic Unit Addition Subtraction Multiplication and DivisionArithmetic Unit Addition Subtraction Multiplication and Division
Arithmetic Unit Addition Subtraction Multiplication and Division
RNShukla7
 
Computer organization and architecture lab manual
Computer organization and architecture lab manual Computer organization and architecture lab manual
Computer organization and architecture lab manual
Shankar Gangaju
 
Computer organization algorithms like addition and subtraction and multiplica...
Computer organization algorithms like addition and subtraction and multiplica...Computer organization algorithms like addition and subtraction and multiplica...
Computer organization algorithms like addition and subtraction and multiplica...
michaelaaron25322
 
Lecture2 binary multiplication
Lecture2 binary multiplicationLecture2 binary multiplication
Lecture2 binary multiplication
景文 饶
 
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and  BCD Add...DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and  BCD Add...
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...
SaveraAyub2
 

Similar to Module 3 of computer organization and architecture (20)

Addition and subtraction with signed magnitude data (mano
Addition and subtraction with signed magnitude data (manoAddition and subtraction with signed magnitude data (mano
Addition and subtraction with signed magnitude data (mano
 
Arithmetic Unit Addition Subtraction Multiplication and Division
Arithmetic Unit Addition Subtraction Multiplication and DivisionArithmetic Unit Addition Subtraction Multiplication and Division
Arithmetic Unit Addition Subtraction Multiplication and Division
 
Arithmetic Microoperation.pdf
Arithmetic Microoperation.pdfArithmetic Microoperation.pdf
Arithmetic Microoperation.pdf
 
CSO PPT.pptx
CSO PPT.pptxCSO PPT.pptx
CSO PPT.pptx
 
Computer arithmetics coa project pdf version
Computer arithmetics coa project pdf versionComputer arithmetics coa project pdf version
Computer arithmetics coa project pdf version
 
Hemanth143
Hemanth143 Hemanth143
Hemanth143
 
Restoring & Non-Restoring Division Algorithm By Sania Nisar
Restoring & Non-Restoring Division Algorithm By Sania NisarRestoring & Non-Restoring Division Algorithm By Sania Nisar
Restoring & Non-Restoring Division Algorithm By Sania Nisar
 
Computer organization and architecture lab manual
Computer organization and architecture lab manual Computer organization and architecture lab manual
Computer organization and architecture lab manual
 
Computer organization algorithms like addition and subtraction and multiplica...
Computer organization algorithms like addition and subtraction and multiplica...Computer organization algorithms like addition and subtraction and multiplica...
Computer organization algorithms like addition and subtraction and multiplica...
 
Lecture2 binary multiplication
Lecture2 binary multiplicationLecture2 binary multiplication
Lecture2 binary multiplication
 
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
 
CA UNIT II.pptx
CA UNIT II.pptxCA UNIT II.pptx
CA UNIT II.pptx
 
Counters r012
Counters  r012Counters  r012
Counters r012
 
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
 
COMPUTER ORGANIZATION NOTES Unit 6
COMPUTER ORGANIZATION NOTES Unit 6COMPUTER ORGANIZATION NOTES Unit 6
COMPUTER ORGANIZATION NOTES Unit 6
 
B sc cs i bo-de u-iii counters & registers
B sc cs i bo-de u-iii counters & registersB sc cs i bo-de u-iii counters & registers
B sc cs i bo-de u-iii counters & registers
 
Chapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdfChapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdf
 
Data representation notes class 11
Data representation notes class 11Data representation notes class 11
Data representation notes class 11
 
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and  BCD Add...DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and  BCD Add...
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...
 
Sequential multiplication
Sequential multiplicationSequential multiplication
Sequential multiplication
 

Recently uploaded

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 

Recently uploaded (20)

Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 

Module 3 of computer organization and architecture

  • 1. COMPUTER ORGANIZATION AND ARCHITECTURE MODULE-3 PART TWO - LIPSA SUBHADARSHINI Subject Code- BC 2007 No. of Credits- 4 BCA 3rd Semester 1
  • 2. CONTENT • Computer Arithmetic • Multiplication Algorithms for fixed point numbers • Division Algorithms for fixed point numbers 2
  • 3. MULTIPLICATION ALGORITHM • Multiplication of two fixed point binary number in signed magnitude representation is done with process of successive shift and add operation. • In the multiplication process we are considering successive bits of the multiplier, least significant bit first. If the multiplier bit is 1, the multiplicand is copied down else 0’s are copied down. • The numbers copied down in successive lines are shifted one position to the left from the previous number. Finally numbers are added and their sum form the product. • The sign of the product is determined from the sign of the multiplicand and multiplier. If they are alike, sign of the product is positive else negative. 3
  • 5. MULTIPLICATION ALGORITHM • Registers: Two Registers B and Q are used to store multiplicand and multiplier respectively. Register A is used to store partial product during multiplication. Sequence Counter register (SC) is used to store number of bits in the multiplier. • Flip Flop: To store sign bit of registers we require three flip flops (A sign, B sign and Q sign). Flip flop E is used to store carry bit generated during partial product addition. • Complement and Parallel adder: This hardware unit is used in calculating partial product i.e, perform addition required. Flowchart of Multiplication • Initially multiplicand is stored in B register and multiplier is stored in Q register. • Sign of registers B (Bs) and Q (Qs) are compared using XOR functionality (i.e., if both the signs are alike, output of XOR operation is 0 unless 1) and output stored in As (sign of A register).Note: Initially 0 is assigned to register A and E flip flop. Sequence counter is initialized with value n, n is the number of bits in the Multiplier. 5
  • 7. MULTIPLICATION ALGORITHM • Now least significant bit of multiplier is checked. If it is 1 add the content of register A with Multiplicand (register B) and result is assigned in A register with carry bit in flip flop E. Content of E A Q is shifted to right by one position, i.e., content of E is shifted to most significant bit (MSB) of A and least significant bit of A is shifted to most significant bit of Q. • If Qn = 0, only shift right operation on content of E A Q is performed in a similar fashion. • Content of Sequence counter is decremented by 1. • Check the content of Sequence counter (SC), if it is 0, end the process and the final product is present in register A and Q, else repeat the process. Example: Multiplicand = 10111 Multiplier = 10011 7
  • 9. DIVISION ALGORITHM • The Division of two fixed-point binary numbers in the signed-magnitude representation is done by the cycle of successive compare, shift, and subtract operations. • The binary division is easier than the decimal division because the quotient digit is either 0 or 1. Also, there is no need to estimate how many times the dividend or partial remainders adjust to the divisor. 9
  • 10. DIVISION ALGORITHM HARDWARE IMPLEMENTATION • The hardware implementation in the division operation is identical to that required for multiplication and consists of the following components – • Here, Registers B is used to store divisor, and the double-length dividend is stored in registers A and Q • The information for the relative magnitude is given in E. • A sequence Counter register (SC) is used to store the number of bits in the dividend. 10
  • 12. DIVISION ALGORITHM • Initially, the dividend is in A & Q and the divisor is in B. • The sign of the result is transferred into Q, to be part of the quotient. Then a constant is set into the SC to specify the number of bits in the quotient. • Since an operand must be saved with its sign, one bit of the word will be inhabited by the sign, and the magnitude will be composed of n -1 bits. • The condition of divide-overflow is checked by subtracting the divisor in B from the half of the bits of the dividend stored in A. If A ≥ B, DVF is set and the operation is terminated before time. If A < B, no overflow condition occurs and so the value of the dividend is reinstated by adding B to A. • The division of the magnitudes starts with the dividend in AQ to left in the high-order bit shifted into E. (Note – If shifted a bit into E is equal to 1, and we know that EA > B as EA comprises a 1 followed by n -1 bits whereas B comprises only n -1 bits). In this case, B must be subtracted from EA, and 1 should insert into Q, for the quotient bit. • If the shift-left operation (shl) inserts a 0 into E, the divisor is subtracted by adding its 2’s complement value and the carry is moved into E. If E = 1, it means that A ≥ B; thus, Q, is set to 1. If E = 0, it means that A < B, and the original number is reimposed by adding B into A. • Now, this process is repeated with register A containing the partial remainder. 12
  • 13. DIVISION ALGORITHM Example of a binary division using digital hardware: Divisor B = 10001, Dividend A = 0111000000 Final Remainder: 00110 Final Quotient: 11010 Now, what if the divisor is greater than or equal to the dividend. In this process, division overflow occurs. EA stores the value of A+B, there is no application of Q here as if the divisor is equal to dividend then Q might 1 and remainder is 0, else in every other condition the value of quotient 1 and remainder equals to the dividend. 13