SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
01KTP – Microprocessor-based systems




 48/32-
 48/32-bit
 division algorithm

             Vittorio GIOVARA
              Alberto GRAND
Formulation of the problem

 Our goal is to find an algorithm that is able
 to compute the residual of the division
 between a 48-bit dividend and a 32-bit
 divisor using an 8086 machine.

 Input numbers are expressed according to
 the module and sign representation.
Invariance property (I)

 The invariance property holds true when
 dividing two real numbers.
 In general, given a, b ∈ R, the result of the
 division a / b will not change if we multiply or
 divide both the dividend and the divisor by a
 given number k other than 0.

 Example: 84 / 6 = (84 / 3) / (6 / 3)
                 = 28 / 2
                 = 12
Invariance property (II)

 How can this property be useful to the solution of
 our problem?
 Since the 8086 processor has built-in capabilities
 for handling 32-bit/16-bit divisions, we may
 choose k = 216 , so as to reduce the length of the
 operands A and B to respectively 32 and 16 bits.
 Note that the division by a power of 2 can
 efficiently be implemented through a right shift.
Invariance property (III)

      A       A / 216
          =              =
      B       B / 216

 Is this result correct?
 Are the two operations still equivalent?
Invariance property (IV)
 In general, the answer is no.
 This is because, by performing a right shift,
 we are discarding all the least significant
 bits of the operands.
 Nonetheless, the result we obtain is still
 close to the true quotient.

Example:
184 / 21 = 8, R = 16
(184 / 10) / (21/10) ≅ 18 / 2 = 9
Approximation of the quotient



 The result obtained by dividing the MS 32 bits of
 A by the MS 16 bits of B may thus be used as an
 initial approximation of the true quotient.
The algorithm (I)

 The division between A47…16 and B31…16 is
 initially performed, regardless of the sign of the
 operands.
 The approximated quotient Q is then multiplied
 by the divisor B, in order to obtain A* .
 A* is subsequently compared with A.
The algorithm (II)
 If A > A*, then we check if their difference
 is larger than B, i.e. we check whether B
 fits one more time in A.
 ◦ If this is the case, A* is incremented by B and
   we go back to the initial test.
 ◦ Otherwise, the difference is the sought
   residual.
 If A > A*, then A* is decremented by B
 and we go back to the initial test.
 Otherwise, A = A*, so the sought residual
 is 0.
Handling of signed values (I)

 The sign of the operands is stored in a
 register (which is then pushed onto the stack)
 and later retrieved to adjust the result.
 This is achieved by means of an AND
 operation between the 8 MSBs of the two
 operands and the bitmask 80H.
Handling of signed values (II)


 Both operands are then made positive by forcing
 a 0 in their MSB, by means of an AND operation
 between the 8 MSBs and the bitmask 7FH.
 The algorithm therefore treats the operands as if
 they were positive.
Adjustment of the residual (I)
 Note that:
17 / 4 = 4, R = 1 = R*

                        BUT

(-17) / 4 = -5, R = 3 = 4 – R*

17 / (-4) = -4, R = 1

(-17) / (-4) = 5, R = 3 = 4 – R*
Adjustment of the residual (II)
 We can infer the rule from the previous
 example:
 ◦ If the dividend is positive, the residual is the
   computed one
 ◦ If the dividend is negative, the residual is the
   complement to the divisor of the computed one.


 The residual is therefore adjusted if the
 dividend is negative.
 The original sign of the operands is finally
 restored.
…that’s all, folks!
…that’s all, folks!

Mais conteúdo relacionado

Mais procurados

Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparatorPreet_patel
 
6 2 magnitudecomparator ibit and 2 bit converted
6 2 magnitudecomparator ibit and 2 bit converted6 2 magnitudecomparator ibit and 2 bit converted
6 2 magnitudecomparator ibit and 2 bit convertedsubisugadevan
 
Low Power VLSI Design of Modified Booth Multiplier
Low Power VLSI Design of Modified Booth MultiplierLow Power VLSI Design of Modified Booth Multiplier
Low Power VLSI Design of Modified Booth Multiplieridescitation
 
Sequential circuit multiplier
Sequential circuit multiplierSequential circuit multiplier
Sequential circuit multiplierSubhram
 
4-bit camparator
4-bit camparator4-bit camparator
4-bit camparatorBilal Amjad
 
Multiplication algorithm
Multiplication algorithmMultiplication algorithm
Multiplication algorithmGaurav Subham
 
Natural Language Processing - Writing Grammar
Natural Language Processing - Writing GrammarNatural Language Processing - Writing Grammar
Natural Language Processing - Writing GrammarJasmine Peniel
 
Digital logic design lecture 3
Digital logic design lecture 3Digital logic design lecture 3
Digital logic design lecture 3shahzad ali
 
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etcBOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etcAbhishek Rajpoot
 
Multiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchartMultiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchartTanjarul Islam Mishu
 
Csci101 lect09 vectorized_code
Csci101 lect09 vectorized_codeCsci101 lect09 vectorized_code
Csci101 lect09 vectorized_codeElsayed Hemayed
 
Digital logic design lecture 2
Digital logic design lecture 2Digital logic design lecture 2
Digital logic design lecture 2shahzad ali
 
The BUT and NBUT Boolean logic
The BUT and NBUT Boolean logicThe BUT and NBUT Boolean logic
The BUT and NBUT Boolean logicsciomathman
 
Conversion of in fix pre fix,infix by sarmad baloch
Conversion of in fix pre fix,infix by sarmad balochConversion of in fix pre fix,infix by sarmad baloch
Conversion of in fix pre fix,infix by sarmad balochSarmad Baloch
 
Csc1100 lecture10 ch08_pt1
Csc1100 lecture10 ch08_pt1Csc1100 lecture10 ch08_pt1
Csc1100 lecture10 ch08_pt1IIUM
 

Mais procurados (20)

Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparator
 
6 2 magnitudecomparator ibit and 2 bit converted
6 2 magnitudecomparator ibit and 2 bit converted6 2 magnitudecomparator ibit and 2 bit converted
6 2 magnitudecomparator ibit and 2 bit converted
 
Low Power VLSI Design of Modified Booth Multiplier
Low Power VLSI Design of Modified Booth MultiplierLow Power VLSI Design of Modified Booth Multiplier
Low Power VLSI Design of Modified Booth Multiplier
 
Unit 4-booth algorithm
Unit 4-booth algorithmUnit 4-booth algorithm
Unit 4-booth algorithm
 
Sequential circuit multiplier
Sequential circuit multiplierSequential circuit multiplier
Sequential circuit multiplier
 
4-bit camparator
4-bit camparator4-bit camparator
4-bit camparator
 
Operators and it's type
Operators and it's type Operators and it's type
Operators and it's type
 
Multiplication algorithm
Multiplication algorithmMultiplication algorithm
Multiplication algorithm
 
Natural Language Processing - Writing Grammar
Natural Language Processing - Writing GrammarNatural Language Processing - Writing Grammar
Natural Language Processing - Writing Grammar
 
Digital logic design lecture 3
Digital logic design lecture 3Digital logic design lecture 3
Digital logic design lecture 3
 
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etcBOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
 
Multiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchartMultiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchart
 
Csci101 lect09 vectorized_code
Csci101 lect09 vectorized_codeCsci101 lect09 vectorized_code
Csci101 lect09 vectorized_code
 
Digital logic design lecture 2
Digital logic design lecture 2Digital logic design lecture 2
Digital logic design lecture 2
 
The BUT and NBUT Boolean logic
The BUT and NBUT Boolean logicThe BUT and NBUT Boolean logic
The BUT and NBUT Boolean logic
 
Conversion of in fix pre fix,infix by sarmad baloch
Conversion of in fix pre fix,infix by sarmad balochConversion of in fix pre fix,infix by sarmad baloch
Conversion of in fix pre fix,infix by sarmad baloch
 
Session03 operators
Session03 operatorsSession03 operators
Session03 operators
 
Csc1100 lecture10 ch08_pt1
Csc1100 lecture10 ch08_pt1Csc1100 lecture10 ch08_pt1
Csc1100 lecture10 ch08_pt1
 
C –imp points
C –imp pointsC –imp points
C –imp points
 
Boothmultiplication
BoothmultiplicationBoothmultiplication
Boothmultiplication
 

Destaque

Euclid's division algorithm
Euclid's division algorithmEuclid's division algorithm
Euclid's division algorithmShubham Kumar
 
Algorithms,graph theory and combinatorics
Algorithms,graph theory and combinatoricsAlgorithms,graph theory and combinatorics
Algorithms,graph theory and combinatoricsProf.Dr.Hanumanthappa J
 
the division algorithm
the division algorithmthe division algorithm
the division algorithmJeneva Clark
 
Module 2 lessson 14
Module 2 lessson 14Module 2 lessson 14
Module 2 lessson 14mlabuski
 
introduction to division algorithm
introduction to division algorithmintroduction to division algorithm
introduction to division algorithmNikhil Sairam
 
Eucledian algorithm for gcd of integers and polynomials
Eucledian algorithm for gcd of integers and polynomialsEucledian algorithm for gcd of integers and polynomials
Eucledian algorithm for gcd of integers and polynomialsSWAMY J S
 
Abel - A great mathematician
Abel - A great mathematicianAbel - A great mathematician
Abel - A great mathematicianNandiniNandus
 
Number theory
Number theory Number theory
Number theory tes31
 
History of Number Theory
History of Number TheoryHistory of Number Theory
History of Number TheoryVolkan Nazife
 
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisEuclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisAmrinder Arora
 
Password based door lock system using 8051 microcontroller final report
Password based door lock system using 8051 microcontroller final reportPassword based door lock system using 8051 microcontroller final report
Password based door lock system using 8051 microcontroller final reportChinaraja Baratam
 
Password based door locking system
Password based door locking systemPassword based door locking system
Password based door locking systemArjun Singh
 
Wireless power theft monitoring
Wireless power theft monitoringWireless power theft monitoring
Wireless power theft monitoringBiswajit Pratihari
 

Destaque (20)

Euclid's division algorithm
Euclid's division algorithmEuclid's division algorithm
Euclid's division algorithm
 
Algorithms,graph theory and combinatorics
Algorithms,graph theory and combinatoricsAlgorithms,graph theory and combinatorics
Algorithms,graph theory and combinatorics
 
the division algorithm
the division algorithmthe division algorithm
the division algorithm
 
Module 2 lessson 14
Module 2 lessson 14Module 2 lessson 14
Module 2 lessson 14
 
introduction to division algorithm
introduction to division algorithmintroduction to division algorithm
introduction to division algorithm
 
Eucledian algorithm for gcd of integers and polynomials
Eucledian algorithm for gcd of integers and polynomialsEucledian algorithm for gcd of integers and polynomials
Eucledian algorithm for gcd of integers and polynomials
 
Abel - A great mathematician
Abel - A great mathematicianAbel - A great mathematician
Abel - A great mathematician
 
Number theory lecture (part 1)
Number theory lecture (part 1)Number theory lecture (part 1)
Number theory lecture (part 1)
 
Number theory
Number theory Number theory
Number theory
 
Number theory Grade 7, 8 and 9
Number theory Grade 7, 8 and 9Number theory Grade 7, 8 and 9
Number theory Grade 7, 8 and 9
 
Number theory
Number theoryNumber theory
Number theory
 
History of Number Theory
History of Number TheoryHistory of Number Theory
History of Number Theory
 
The Number Theory
The Number TheoryThe Number Theory
The Number Theory
 
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisEuclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
 
Number theory
Number theoryNumber theory
Number theory
 
Remainder theorem
Remainder theoremRemainder theorem
Remainder theorem
 
Password based door lock system using 8051 microcontroller final report
Password based door lock system using 8051 microcontroller final reportPassword based door lock system using 8051 microcontroller final report
Password based door lock system using 8051 microcontroller final report
 
Password based door locking system
Password based door locking systemPassword based door locking system
Password based door locking system
 
Project ppt
Project pptProject ppt
Project ppt
 
Wireless power theft monitoring
Wireless power theft monitoringWireless power theft monitoring
Wireless power theft monitoring
 

Semelhante a Microprocessor-based Systems 48/32bit Division Algorithm

Module_2_dspgggffffggggggggggggggga.pptx
Module_2_dspgggffffggggggggggggggga.pptxModule_2_dspgggffffggggggggggggggga.pptx
Module_2_dspgggffffggggggggggggggga.pptxrealme6igamerr
 
Ayush Jajoo(MCA2501622) AOA .pptx
Ayush Jajoo(MCA2501622) AOA .pptxAyush Jajoo(MCA2501622) AOA .pptx
Ayush Jajoo(MCA2501622) AOA .pptxAmanChoudhary329978
 
DESIGN OF RADIX-8 BOOTH MULTIPLIER USING KOGGESTONE ADDER FOR HIGH SPEED ARIT...
DESIGN OF RADIX-8 BOOTH MULTIPLIER USING KOGGESTONE ADDER FOR HIGH SPEED ARIT...DESIGN OF RADIX-8 BOOTH MULTIPLIER USING KOGGESTONE ADDER FOR HIGH SPEED ARIT...
DESIGN OF RADIX-8 BOOTH MULTIPLIER USING KOGGESTONE ADDER FOR HIGH SPEED ARIT...eeiej_journal
 
IRJET- Realization of Decimal Multiplication using Radix-16 Modified Booth En...
IRJET- Realization of Decimal Multiplication using Radix-16 Modified Booth En...IRJET- Realization of Decimal Multiplication using Radix-16 Modified Booth En...
IRJET- Realization of Decimal Multiplication using Radix-16 Modified Booth En...IRJET Journal
 
IRJET- Radix 8 Booth Encoded Interleaved Modular Multiplication
IRJET- Radix 8 Booth Encoded Interleaved Modular MultiplicationIRJET- Radix 8 Booth Encoded Interleaved Modular Multiplication
IRJET- Radix 8 Booth Encoded Interleaved Modular MultiplicationIRJET Journal
 
Bitwise Operations(1).pdf
Bitwise Operations(1).pdfBitwise Operations(1).pdf
Bitwise Operations(1).pdfDalvinCalvin
 
IRJET- An Efficient Multiply Accumulate Unit Design using Vedic Mathematics A...
IRJET- An Efficient Multiply Accumulate Unit Design using Vedic Mathematics A...IRJET- An Efficient Multiply Accumulate Unit Design using Vedic Mathematics A...
IRJET- An Efficient Multiply Accumulate Unit Design using Vedic Mathematics A...IRJET Journal
 
Unit-8-Computer-Arithmetic.pdf
Unit-8-Computer-Arithmetic.pdfUnit-8-Computer-Arithmetic.pdf
Unit-8-Computer-Arithmetic.pdfGafryMahmoud
 
index of all of the financial accounts in a company's general ledger. In shor...
index of all of the financial accounts in a company's general ledger. In shor...index of all of the financial accounts in a company's general ledger. In shor...
index of all of the financial accounts in a company's general ledger. In shor...mayurjagdale4
 
Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...
Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...
Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...UmerKhan147799
 
Development of an Algorithm for 16-Bit WTM
Development of an Algorithm for 16-Bit WTMDevelopment of an Algorithm for 16-Bit WTM
Development of an Algorithm for 16-Bit WTMIOSR Journals
 
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...ijcisjournal
 
Lecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of InstructionsLecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of InstructionsZeeshan Ahmed
 
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORRamaPrabha24
 

Semelhante a Microprocessor-based Systems 48/32bit Division Algorithm (20)

Module_2_dspgggffffggggggggggggggga.pptx
Module_2_dspgggffffggggggggggggggga.pptxModule_2_dspgggffffggggggggggggggga.pptx
Module_2_dspgggffffggggggggggggggga.pptx
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
Fourier Transform Assignment Help
Fourier Transform Assignment HelpFourier Transform Assignment Help
Fourier Transform Assignment Help
 
Ayush Jajoo(MCA2501622) AOA .pptx
Ayush Jajoo(MCA2501622) AOA .pptxAyush Jajoo(MCA2501622) AOA .pptx
Ayush Jajoo(MCA2501622) AOA .pptx
 
DESIGN OF RADIX-8 BOOTH MULTIPLIER USING KOGGESTONE ADDER FOR HIGH SPEED ARIT...
DESIGN OF RADIX-8 BOOTH MULTIPLIER USING KOGGESTONE ADDER FOR HIGH SPEED ARIT...DESIGN OF RADIX-8 BOOTH MULTIPLIER USING KOGGESTONE ADDER FOR HIGH SPEED ARIT...
DESIGN OF RADIX-8 BOOTH MULTIPLIER USING KOGGESTONE ADDER FOR HIGH SPEED ARIT...
 
IRJET- Realization of Decimal Multiplication using Radix-16 Modified Booth En...
IRJET- Realization of Decimal Multiplication using Radix-16 Modified Booth En...IRJET- Realization of Decimal Multiplication using Radix-16 Modified Booth En...
IRJET- Realization of Decimal Multiplication using Radix-16 Modified Booth En...
 
IRJET- Radix 8 Booth Encoded Interleaved Modular Multiplication
IRJET- Radix 8 Booth Encoded Interleaved Modular MultiplicationIRJET- Radix 8 Booth Encoded Interleaved Modular Multiplication
IRJET- Radix 8 Booth Encoded Interleaved Modular Multiplication
 
Bitwise Operations(1).pdf
Bitwise Operations(1).pdfBitwise Operations(1).pdf
Bitwise Operations(1).pdf
 
IRJET- An Efficient Multiply Accumulate Unit Design using Vedic Mathematics A...
IRJET- An Efficient Multiply Accumulate Unit Design using Vedic Mathematics A...IRJET- An Efficient Multiply Accumulate Unit Design using Vedic Mathematics A...
IRJET- An Efficient Multiply Accumulate Unit Design using Vedic Mathematics A...
 
Calculating garbage value in case of overflow
Calculating garbage value in case of overflowCalculating garbage value in case of overflow
Calculating garbage value in case of overflow
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
Unit-8-Computer-Arithmetic.pdf
Unit-8-Computer-Arithmetic.pdfUnit-8-Computer-Arithmetic.pdf
Unit-8-Computer-Arithmetic.pdf
 
index of all of the financial accounts in a company's general ledger. In shor...
index of all of the financial accounts in a company's general ledger. In shor...index of all of the financial accounts in a company's general ledger. In shor...
index of all of the financial accounts in a company's general ledger. In shor...
 
Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...
Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...
Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...
 
Chapter 9.pdf
Chapter 9.pdfChapter 9.pdf
Chapter 9.pdf
 
L010137986
L010137986L010137986
L010137986
 
Development of an Algorithm for 16-Bit WTM
Development of an Algorithm for 16-Bit WTMDevelopment of an Algorithm for 16-Bit WTM
Development of an Algorithm for 16-Bit WTM
 
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
 
Lecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of InstructionsLecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of Instructions
 
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
 

Mais de Vittorio Giovara

Color me intrigued: A jaunt through color technology in video
Color me intrigued: A jaunt through color technology in videoColor me intrigued: A jaunt through color technology in video
Color me intrigued: A jaunt through color technology in videoVittorio Giovara
 
An overview on 10 bit video: UHDTV, HDR, and coding efficiency
An overview on 10 bit video: UHDTV, HDR, and coding efficiencyAn overview on 10 bit video: UHDTV, HDR, and coding efficiency
An overview on 10 bit video: UHDTV, HDR, and coding efficiencyVittorio Giovara
 
Introduction to video reverse engineering
Introduction to video reverse engineeringIntroduction to video reverse engineering
Introduction to video reverse engineeringVittorio Giovara
 
Block Cipher Modes of Operation And Cmac For Authentication
Block Cipher Modes of Operation And Cmac For AuthenticationBlock Cipher Modes of Operation And Cmac For Authentication
Block Cipher Modes of Operation And Cmac For AuthenticationVittorio Giovara
 
Fuzzing Techniques for Software Vulnerability Discovery
Fuzzing Techniques for Software Vulnerability DiscoveryFuzzing Techniques for Software Vulnerability Discovery
Fuzzing Techniques for Software Vulnerability DiscoveryVittorio Giovara
 
Parallel and Distributed Computing on Low Latency Clusters
Parallel and Distributed Computing on Low Latency ClustersParallel and Distributed Computing on Low Latency Clusters
Parallel and Distributed Computing on Low Latency ClustersVittorio Giovara
 
Software Requirements for Safety-related Systems
Software Requirements for Safety-related SystemsSoftware Requirements for Safety-related Systems
Software Requirements for Safety-related SystemsVittorio Giovara
 
Misra C Software Development Standard
Misra C Software Development StandardMisra C Software Development Standard
Misra C Software Development StandardVittorio Giovara
 
OpenSSL User Manual and Data Format
OpenSSL User Manual and Data FormatOpenSSL User Manual and Data Format
OpenSSL User Manual and Data FormatVittorio Giovara
 
Authenticated Encryption Gcm Ccm
Authenticated Encryption Gcm CcmAuthenticated Encryption Gcm Ccm
Authenticated Encryption Gcm CcmVittorio Giovara
 

Mais de Vittorio Giovara (13)

Color me intrigued: A jaunt through color technology in video
Color me intrigued: A jaunt through color technology in videoColor me intrigued: A jaunt through color technology in video
Color me intrigued: A jaunt through color technology in video
 
An overview on 10 bit video: UHDTV, HDR, and coding efficiency
An overview on 10 bit video: UHDTV, HDR, and coding efficiencyAn overview on 10 bit video: UHDTV, HDR, and coding efficiency
An overview on 10 bit video: UHDTV, HDR, and coding efficiency
 
Introduction to video reverse engineering
Introduction to video reverse engineeringIntroduction to video reverse engineering
Introduction to video reverse engineering
 
Il Caso Ryanair
Il Caso RyanairIl Caso Ryanair
Il Caso Ryanair
 
I Mercati Geografici
I Mercati GeograficiI Mercati Geografici
I Mercati Geografici
 
Block Cipher Modes of Operation And Cmac For Authentication
Block Cipher Modes of Operation And Cmac For AuthenticationBlock Cipher Modes of Operation And Cmac For Authentication
Block Cipher Modes of Operation And Cmac For Authentication
 
Crittografia Quantistica
Crittografia QuantisticaCrittografia Quantistica
Crittografia Quantistica
 
Fuzzing Techniques for Software Vulnerability Discovery
Fuzzing Techniques for Software Vulnerability DiscoveryFuzzing Techniques for Software Vulnerability Discovery
Fuzzing Techniques for Software Vulnerability Discovery
 
Parallel and Distributed Computing on Low Latency Clusters
Parallel and Distributed Computing on Low Latency ClustersParallel and Distributed Computing on Low Latency Clusters
Parallel and Distributed Computing on Low Latency Clusters
 
Software Requirements for Safety-related Systems
Software Requirements for Safety-related SystemsSoftware Requirements for Safety-related Systems
Software Requirements for Safety-related Systems
 
Misra C Software Development Standard
Misra C Software Development StandardMisra C Software Development Standard
Misra C Software Development Standard
 
OpenSSL User Manual and Data Format
OpenSSL User Manual and Data FormatOpenSSL User Manual and Data Format
OpenSSL User Manual and Data Format
 
Authenticated Encryption Gcm Ccm
Authenticated Encryption Gcm CcmAuthenticated Encryption Gcm Ccm
Authenticated Encryption Gcm Ccm
 

Último

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 

Último (20)

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 

Microprocessor-based Systems 48/32bit Division Algorithm

  • 1. 01KTP – Microprocessor-based systems 48/32- 48/32-bit division algorithm Vittorio GIOVARA Alberto GRAND
  • 2. Formulation of the problem Our goal is to find an algorithm that is able to compute the residual of the division between a 48-bit dividend and a 32-bit divisor using an 8086 machine. Input numbers are expressed according to the module and sign representation.
  • 3. Invariance property (I) The invariance property holds true when dividing two real numbers. In general, given a, b ∈ R, the result of the division a / b will not change if we multiply or divide both the dividend and the divisor by a given number k other than 0. Example: 84 / 6 = (84 / 3) / (6 / 3) = 28 / 2 = 12
  • 4. Invariance property (II) How can this property be useful to the solution of our problem? Since the 8086 processor has built-in capabilities for handling 32-bit/16-bit divisions, we may choose k = 216 , so as to reduce the length of the operands A and B to respectively 32 and 16 bits. Note that the division by a power of 2 can efficiently be implemented through a right shift.
  • 5. Invariance property (III) A A / 216 = = B B / 216 Is this result correct? Are the two operations still equivalent?
  • 6. Invariance property (IV) In general, the answer is no. This is because, by performing a right shift, we are discarding all the least significant bits of the operands. Nonetheless, the result we obtain is still close to the true quotient. Example: 184 / 21 = 8, R = 16 (184 / 10) / (21/10) ≅ 18 / 2 = 9
  • 7. Approximation of the quotient The result obtained by dividing the MS 32 bits of A by the MS 16 bits of B may thus be used as an initial approximation of the true quotient.
  • 8. The algorithm (I) The division between A47…16 and B31…16 is initially performed, regardless of the sign of the operands. The approximated quotient Q is then multiplied by the divisor B, in order to obtain A* . A* is subsequently compared with A.
  • 9. The algorithm (II) If A > A*, then we check if their difference is larger than B, i.e. we check whether B fits one more time in A. ◦ If this is the case, A* is incremented by B and we go back to the initial test. ◦ Otherwise, the difference is the sought residual. If A > A*, then A* is decremented by B and we go back to the initial test. Otherwise, A = A*, so the sought residual is 0.
  • 10. Handling of signed values (I) The sign of the operands is stored in a register (which is then pushed onto the stack) and later retrieved to adjust the result. This is achieved by means of an AND operation between the 8 MSBs of the two operands and the bitmask 80H.
  • 11. Handling of signed values (II) Both operands are then made positive by forcing a 0 in their MSB, by means of an AND operation between the 8 MSBs and the bitmask 7FH. The algorithm therefore treats the operands as if they were positive.
  • 12. Adjustment of the residual (I) Note that: 17 / 4 = 4, R = 1 = R* BUT (-17) / 4 = -5, R = 3 = 4 – R* 17 / (-4) = -4, R = 1 (-17) / (-4) = 5, R = 3 = 4 – R*
  • 13. Adjustment of the residual (II) We can infer the rule from the previous example: ◦ If the dividend is positive, the residual is the computed one ◦ If the dividend is negative, the residual is the complement to the divisor of the computed one. The residual is therefore adjusted if the dividend is negative. The original sign of the operands is finally restored.