SlideShare ist ein Scribd-Unternehmen logo
1 von 14
MICROCOMPUTER ARCHITECTURE
ARITHMETIC
ARITHMETIC
INSTRUCTION
PRESENTED BY
M.RAMYA
M.sc (CS&IT)
NSCAT
The 8086 provides many arithmetic operations: addition, subtraction,
negation, multiplication and comparing.
The arithmetic operation are performing in:
 binary
 packed BCD and
 unpacked BCD.
ASCII input
Conversion
….. Do work in binary
Conversion
ASCII output
Unpacked BCD format
Binary format
Binary format
Unpacked BCD format
BINARY ARITHMETIC
• BCD reference each of the digits of on unsigned decimal as the 4 bit binary equivalent
other binary arithmetic instructions, can operate on either bytes or words.
• All of them effective all of the condition flags . They may use any of the addressing
modes for one of the operands , but , except when the source operand is immediate , one
of the two operands must be a register
Binary addition and subtraction instructions.
Name Mnemonic and Format Description
Add ADD DST,SRC (DST) (SRC)+(DST)
Add with carry ADC DST,SRC (DST) (SRC)+(DST)+(CF)
Subtract SUB DST,SRC (DST) (DST)-(SRC)
Subtract with borrow SBB DST,SRC (DST) (DST)-(SRC)-(CF)
The arithmetic involving one word operands is called single – precision arithmetic,
involving two words operands is called double – precision arithmetic , and soon in
general , anything higher than single – precision is referred to as multiple precision.
Single – precision example Double – precision addition
MOV AX,X MOV AX,DP1
ADD AX,Y ADD AX,DP2
ADD AX,24 MOV DP SUM,AX
SUB AX,Z MOV AX,DP1+2
MOV W,AX ADC AX,DP2+2
MOV DP SUM+2,AX
Signed mixed mode arithmetic involving two different precision can be
performed by extending the sign of the shorter number until the numbers have the
same length. The CBW and CWD instructions are defined .
The CBW instructions extends the sign of the byte in AL to yield an equivalent
2’s complement 1-word result in AX. The CWD extends the sign of the word in AX
to DX , thus forming a double word in DX:AX
Name Mnemonic and format Description
Convert byte to
word
CBW Extend sign of AL to AH
Convert word to
double word
CWD Extend sign of AX to DX
• That INC and DEC leave the CF flag unchanged, all of the condition flags are
affected by these instructions.
• The INC, DEC and NEG instructions have only one operand.
Single operand binary arithmetic instructions and the compare instruction.
Name Mnemonic and Formats Descriptions
Increment INC OPR (OPR) (OPR)+1
Decrement DEC OPR (OPR) (OPR)-1
Negate NEG OPR (OPR) - (OPR)
Compare CMP OPR1,OPR2 (OPR 1)- (OPR 2)
The unsigned multiply instruction, MUL, treats the operands as unsigned
numbers and produces an unsigned product. To construct the IMUL and MUL
instructions
The IDIV nor DIV instruction leaves meaningful information in any of the
conditional flags and as with the multiply instructions.
IDIV BL
(AH)=24=3610 = remainder
(AL)=F3= - 1310 = quotient
DIV BL
(AH)=7C=12410 = remainder
(Al)=05=510 = quotient
PACKED BCD ARITHMETIC
• It packs two decimal digit into single byte.
• It is stored two digits to a byte , in 4 – bit groups referred to as nibbles.
• The ALU is capable of performing only binary addition and subtraction , but
adjusting the sum or difference the correct result in packed BCD format.
• The special addition and subtraction instructions are DAA and DAS are defined.
• DAA adds 6s where they are needed, DAS causes 6s to be subtracted.
PACKED BCD ADJUST INSTRUCTIONS
Name Mnemonic and Format Description
Decimal adjust for addition DAA (AL) Sum in AL adjusted
to packed BCD format
Decimal adjust for
subtraction
DAS (AL) Difference in AL
adjusted to packed BCD
format
Example:
UNPACKED BCD ARITHMETIC
• It is represents contains only one decimal digits per byte. The digit is stored in the
least significant 4 bits.
• The most significant 4 bits are not relevant to the value of the represented number.
• Unpacked BCD addition, subtraction and multiplication are accomplished in much
the same way as packed BCD addition and subtraction in that the binary operations
act on single byte.
microcomputer architecture - Arithmetic instruction

Weitere ähnliche Inhalte

Was ist angesagt?

Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
9840596838
 
0015.register allocation-graph-coloring
0015.register allocation-graph-coloring0015.register allocation-graph-coloring
0015.register allocation-graph-coloring
sean chen
 
10 8086 instruction set
10 8086 instruction set10 8086 instruction set
10 8086 instruction set
Shivam Singhal
 

Was ist angesagt? (20)

instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modes
 
Principles of Combinational Logic-1
Principles of Combinational Logic-1Principles of Combinational Logic-1
Principles of Combinational Logic-1
 
Multiplication & division instructions microprocessor 8086
Multiplication & division instructions microprocessor 8086Multiplication & division instructions microprocessor 8086
Multiplication & division instructions microprocessor 8086
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Compiler unit 5
Compiler  unit 5Compiler  unit 5
Compiler unit 5
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction Format
 
Instruction Set Of 8086 DIU CSE
Instruction Set Of 8086 DIU CSEInstruction Set Of 8086 DIU CSE
Instruction Set Of 8086 DIU CSE
 
arithmetic ins in 8051
arithmetic ins in 8051arithmetic ins in 8051
arithmetic ins in 8051
 
Instruction set (prasenjit dey)
Instruction set (prasenjit dey)Instruction set (prasenjit dey)
Instruction set (prasenjit dey)
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
 
8085 arithmetic instructions
8085 arithmetic instructions8085 arithmetic instructions
8085 arithmetic instructions
 
0015.register allocation-graph-coloring
0015.register allocation-graph-coloring0015.register allocation-graph-coloring
0015.register allocation-graph-coloring
 
Displacement addressing
Displacement addressingDisplacement addressing
Displacement addressing
 
Assembly Language Lecture 4
Assembly Language Lecture 4Assembly Language Lecture 4
Assembly Language Lecture 4
 
10 8086 instruction set
10 8086 instruction set10 8086 instruction set
10 8086 instruction set
 
Lecture 06
Lecture 06Lecture 06
Lecture 06
 

Ähnlich wie microcomputer architecture - Arithmetic instruction

Chap 3_2.ppt
Chap 3_2.pptChap 3_2.ppt
Chap 3_2.ppt
inian2
 
8086 arch instns
8086 arch instns8086 arch instns
8086 arch instns
Ram Babu
 

Ähnlich wie microcomputer architecture - Arithmetic instruction (20)

Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
8086 Instruction set
8086 Instruction set8086 Instruction set
8086 Instruction set
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
 
Arithmetic instrctions
Arithmetic instrctionsArithmetic instrctions
Arithmetic instrctions
 
Microprocessor 8086 instruction description
Microprocessor 8086 instruction descriptionMicroprocessor 8086 instruction description
Microprocessor 8086 instruction description
 
Instruction set
Instruction setInstruction set
Instruction set
 
Traduccion a ensamblador
Traduccion a ensambladorTraduccion a ensamblador
Traduccion a ensamblador
 
Bcd and ascii arithmetic instructions
Bcd and ascii arithmetic instructionsBcd and ascii arithmetic instructions
Bcd and ascii arithmetic instructions
 
Ascii arithmetic instructions
Ascii arithmetic instructionsAscii arithmetic instructions
Ascii arithmetic instructions
 
15CS44 MP & MC Module 2
15CS44 MP & MC Module  215CS44 MP & MC Module  2
15CS44 MP & MC Module 2
 
Chap 3_2.ppt
Chap 3_2.pptChap 3_2.ppt
Chap 3_2.ppt
 
Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)
 
Bcd arithmetic instructions
Bcd arithmetic instructionsBcd arithmetic instructions
Bcd arithmetic instructions
 
15CS44 MP &MC Module 3
15CS44 MP &MC Module 315CS44 MP &MC Module 3
15CS44 MP &MC Module 3
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
8086 arch instns
8086 arch instns8086 arch instns
8086 arch instns
 
Chap3 8086 artithmetic
Chap3 8086 artithmeticChap3 8086 artithmetic
Chap3 8086 artithmetic
 
8086 ins2 math
8086 ins2 math8086 ins2 math
8086 ins2 math
 
Chapter 3 8086 ins2 math
Chapter 3 8086 ins2 mathChapter 3 8086 ins2 math
Chapter 3 8086 ins2 math
 

Mehr von ramya marichamy

Mehr von ramya marichamy (19)

NETWORK DEVICE SECURITY NETWORK HARDENING
NETWORK DEVICE SECURITY NETWORK HARDENINGNETWORK DEVICE SECURITY NETWORK HARDENING
NETWORK DEVICE SECURITY NETWORK HARDENING
 
DIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATION
DIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATIONDIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATION
DIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATION
 
Image processing
Image processingImage processing
Image processing
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
Servlets api overview
Servlets api overviewServlets api overview
Servlets api overview
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Design notation
Design notationDesign notation
Design notation
 
Mining single dimensional boolean association rules from transactional
Mining single dimensional boolean association rules from transactionalMining single dimensional boolean association rules from transactional
Mining single dimensional boolean association rules from transactional
 
Architecture of data mining system
Architecture of data mining systemArchitecture of data mining system
Architecture of data mining system
 
segmentation
segmentationsegmentation
segmentation
 
File Management
File ManagementFile Management
File Management
 
Arithmetic & Logic Unit
Arithmetic & Logic UnitArithmetic & Logic Unit
Arithmetic & Logic Unit
 
SHADOW PAGING and BUFFER MANAGEMENT
SHADOW PAGING and BUFFER MANAGEMENTSHADOW PAGING and BUFFER MANAGEMENT
SHADOW PAGING and BUFFER MANAGEMENT
 
B+ tree
B+ treeB+ tree
B+ tree
 
pointer, virtual function and polymorphism
pointer, virtual function and polymorphismpointer, virtual function and polymorphism
pointer, virtual function and polymorphism
 
Managing console i/o operation,working with files
Managing console i/o operation,working with filesManaging console i/o operation,working with files
Managing console i/o operation,working with files
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
High speed lan
High speed lanHigh speed lan
High speed lan
 

Kürzlich hochgeladen

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 

Kürzlich hochgeladen (20)

psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

microcomputer architecture - Arithmetic instruction

  • 2. The 8086 provides many arithmetic operations: addition, subtraction, negation, multiplication and comparing. The arithmetic operation are performing in:  binary  packed BCD and  unpacked BCD.
  • 3.
  • 4. ASCII input Conversion ….. Do work in binary Conversion ASCII output Unpacked BCD format Binary format Binary format Unpacked BCD format
  • 5. BINARY ARITHMETIC • BCD reference each of the digits of on unsigned decimal as the 4 bit binary equivalent other binary arithmetic instructions, can operate on either bytes or words. • All of them effective all of the condition flags . They may use any of the addressing modes for one of the operands , but , except when the source operand is immediate , one of the two operands must be a register Binary addition and subtraction instructions. Name Mnemonic and Format Description Add ADD DST,SRC (DST) (SRC)+(DST) Add with carry ADC DST,SRC (DST) (SRC)+(DST)+(CF) Subtract SUB DST,SRC (DST) (DST)-(SRC) Subtract with borrow SBB DST,SRC (DST) (DST)-(SRC)-(CF)
  • 6. The arithmetic involving one word operands is called single – precision arithmetic, involving two words operands is called double – precision arithmetic , and soon in general , anything higher than single – precision is referred to as multiple precision. Single – precision example Double – precision addition MOV AX,X MOV AX,DP1 ADD AX,Y ADD AX,DP2 ADD AX,24 MOV DP SUM,AX SUB AX,Z MOV AX,DP1+2 MOV W,AX ADC AX,DP2+2 MOV DP SUM+2,AX
  • 7. Signed mixed mode arithmetic involving two different precision can be performed by extending the sign of the shorter number until the numbers have the same length. The CBW and CWD instructions are defined . The CBW instructions extends the sign of the byte in AL to yield an equivalent 2’s complement 1-word result in AX. The CWD extends the sign of the word in AX to DX , thus forming a double word in DX:AX Name Mnemonic and format Description Convert byte to word CBW Extend sign of AL to AH Convert word to double word CWD Extend sign of AX to DX
  • 8. • That INC and DEC leave the CF flag unchanged, all of the condition flags are affected by these instructions. • The INC, DEC and NEG instructions have only one operand. Single operand binary arithmetic instructions and the compare instruction. Name Mnemonic and Formats Descriptions Increment INC OPR (OPR) (OPR)+1 Decrement DEC OPR (OPR) (OPR)-1 Negate NEG OPR (OPR) - (OPR) Compare CMP OPR1,OPR2 (OPR 1)- (OPR 2)
  • 9. The unsigned multiply instruction, MUL, treats the operands as unsigned numbers and produces an unsigned product. To construct the IMUL and MUL instructions The IDIV nor DIV instruction leaves meaningful information in any of the conditional flags and as with the multiply instructions. IDIV BL (AH)=24=3610 = remainder (AL)=F3= - 1310 = quotient DIV BL (AH)=7C=12410 = remainder (Al)=05=510 = quotient
  • 10. PACKED BCD ARITHMETIC • It packs two decimal digit into single byte. • It is stored two digits to a byte , in 4 – bit groups referred to as nibbles. • The ALU is capable of performing only binary addition and subtraction , but adjusting the sum or difference the correct result in packed BCD format. • The special addition and subtraction instructions are DAA and DAS are defined. • DAA adds 6s where they are needed, DAS causes 6s to be subtracted.
  • 11. PACKED BCD ADJUST INSTRUCTIONS Name Mnemonic and Format Description Decimal adjust for addition DAA (AL) Sum in AL adjusted to packed BCD format Decimal adjust for subtraction DAS (AL) Difference in AL adjusted to packed BCD format
  • 13. UNPACKED BCD ARITHMETIC • It is represents contains only one decimal digits per byte. The digit is stored in the least significant 4 bits. • The most significant 4 bits are not relevant to the value of the represented number. • Unpacked BCD addition, subtraction and multiplication are accomplished in much the same way as packed BCD addition and subtraction in that the binary operations act on single byte.