SlideShare a Scribd company logo
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.
microcomputer architecture - Arithmetic instruction
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

More Related Content

What's hot (20)

PPTX
instruction format and addressing modes
RamaPrabha24
 
PPT
Principles of Combinational Logic-1
Supanna Shirguppe
 
PPTX
Multiplication & division instructions microprocessor 8086
University of Gujrat, Pakistan
 
PPTX
Register allocation and assignment
Karthi Keyan
 
PPTX
Instruction sets of 8086
Mahalakshmiv11
 
PPTX
8086 instruction set
Sazzad Hossain
 
PPTX
Instruction set of 8086
9840596838
 
PDF
Compiler unit 5
BBDITM LUCKNOW
 
DOCX
Instruction set of 8086
Vijay Kumar
 
PPTX
Types of Instruction Format
Dhrumil Panchal
 
PPTX
Instruction Set Of 8086 DIU CSE
salmancreation
 
PPT
arithmetic ins in 8051
VJ Aiswaryadevi
 
PPTX
Instruction set (prasenjit dey)
Prasenjit Dey
 
PDF
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Bilal Amjad
 
PDF
8085 arithmetic instructions
prashant1271
 
PPT
0015.register allocation-graph-coloring
sean chen
 
PDF
Displacement addressing
Rajon
 
PPT
Assembly Language Lecture 4
Motaz Saad
 
PPT
10 8086 instruction set
Shivam Singhal
 
PPT
Lecture 06
sohelranasweet
 
instruction format and addressing modes
RamaPrabha24
 
Principles of Combinational Logic-1
Supanna Shirguppe
 
Multiplication & division instructions microprocessor 8086
University of Gujrat, Pakistan
 
Register allocation and assignment
Karthi Keyan
 
Instruction sets of 8086
Mahalakshmiv11
 
8086 instruction set
Sazzad Hossain
 
Instruction set of 8086
9840596838
 
Compiler unit 5
BBDITM LUCKNOW
 
Instruction set of 8086
Vijay Kumar
 
Types of Instruction Format
Dhrumil Panchal
 
Instruction Set Of 8086 DIU CSE
salmancreation
 
arithmetic ins in 8051
VJ Aiswaryadevi
 
Instruction set (prasenjit dey)
Prasenjit Dey
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Bilal Amjad
 
8085 arithmetic instructions
prashant1271
 
0015.register allocation-graph-coloring
sean chen
 
Displacement addressing
Rajon
 
Assembly Language Lecture 4
Motaz Saad
 
10 8086 instruction set
Shivam Singhal
 
Lecture 06
sohelranasweet
 

Similar to microcomputer architecture - Arithmetic instruction (20)

PDF
6 arithmetic logic inst and prog
Channabasappa Kudarihal
 
PPTX
Arithmetic instrctions
HarshitParkar6677
 
PPTX
Chap3 8086 artithmetic
HarshitParkar6677
 
PPTX
Chapter 3 8086 ins2 math
HarshitParkar6677
 
PPTX
8086 ins2 math
HarshitParkar6677
 
PPTX
Module 2 (1).pptx
Dr. Thippeswamy S.
 
PPT
Arithmetic & logical operations in 8051
Jay Patel
 
DOCX
Notes arithmetic instructions
HarshitParkar6677
 
PPTX
Mod-2.pptx
Dr. Thippeswamy S.
 
PPTX
Bcd arithmetic instructions
Dr. Girish GS
 
PPTX
Bcd and ascii arithmetic instructions
Dr. Girish GS
 
PPTX
Ascii arithmetic instructions
Dr. Girish GS
 
PPTX
Arithmetic and logical instructions 8051 microcontroller
UshaRani289
 
PPTX
8086 Instruction set
karthiga selvaraju
 
PPTX
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
JEEVANANTHAMG6
 
PPTX
Arithmetic instructions
Robert Almazan
 
DOCX
Unit ii microcontrollers final
SARITHA REDDY
 
PPT
Cha_2b_8086-Instruction-set-ppt microprocessor
punithram164
 
PPTX
Arithmetic and logical instructions set
Robert Almazan
 
6 arithmetic logic inst and prog
Channabasappa Kudarihal
 
Arithmetic instrctions
HarshitParkar6677
 
Chap3 8086 artithmetic
HarshitParkar6677
 
Chapter 3 8086 ins2 math
HarshitParkar6677
 
8086 ins2 math
HarshitParkar6677
 
Module 2 (1).pptx
Dr. Thippeswamy S.
 
Arithmetic & logical operations in 8051
Jay Patel
 
Notes arithmetic instructions
HarshitParkar6677
 
Mod-2.pptx
Dr. Thippeswamy S.
 
Bcd arithmetic instructions
Dr. Girish GS
 
Bcd and ascii arithmetic instructions
Dr. Girish GS
 
Ascii arithmetic instructions
Dr. Girish GS
 
Arithmetic and logical instructions 8051 microcontroller
UshaRani289
 
8086 Instruction set
karthiga selvaraju
 
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
JEEVANANTHAMG6
 
Arithmetic instructions
Robert Almazan
 
Unit ii microcontrollers final
SARITHA REDDY
 
Cha_2b_8086-Instruction-set-ppt microprocessor
punithram164
 
Arithmetic and logical instructions set
Robert Almazan
 
Ad

More from ramya marichamy (19)

PPTX
NETWORK DEVICE SECURITY NETWORK HARDENING
ramya marichamy
 
PPTX
DIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATION
ramya marichamy
 
PPTX
Image processing
ramya marichamy
 
PPTX
Classical encryption techniques
ramya marichamy
 
PPTX
Servlets api overview
ramya marichamy
 
PPTX
Divide and conquer
ramya marichamy
 
PPTX
Region based segmentation
ramya marichamy
 
PPTX
Design notation
ramya marichamy
 
PPTX
Mining single dimensional boolean association rules from transactional
ramya marichamy
 
PPTX
Architecture of data mining system
ramya marichamy
 
PPTX
segmentation
ramya marichamy
 
PPTX
File Management
ramya marichamy
 
PPTX
Arithmetic & Logic Unit
ramya marichamy
 
PPTX
SHADOW PAGING and BUFFER MANAGEMENT
ramya marichamy
 
PPTX
B+ tree
ramya marichamy
 
PPTX
pointer, virtual function and polymorphism
ramya marichamy
 
PPTX
Managing console i/o operation,working with files
ramya marichamy
 
PPTX
Operator overloading
ramya marichamy
 
PPTX
High speed lan
ramya marichamy
 
NETWORK DEVICE SECURITY NETWORK HARDENING
ramya marichamy
 
DIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATION
ramya marichamy
 
Image processing
ramya marichamy
 
Classical encryption techniques
ramya marichamy
 
Servlets api overview
ramya marichamy
 
Divide and conquer
ramya marichamy
 
Region based segmentation
ramya marichamy
 
Design notation
ramya marichamy
 
Mining single dimensional boolean association rules from transactional
ramya marichamy
 
Architecture of data mining system
ramya marichamy
 
segmentation
ramya marichamy
 
File Management
ramya marichamy
 
Arithmetic & Logic Unit
ramya marichamy
 
SHADOW PAGING and BUFFER MANAGEMENT
ramya marichamy
 
pointer, virtual function and polymorphism
ramya marichamy
 
Managing console i/o operation,working with files
ramya marichamy
 
Operator overloading
ramya marichamy
 
High speed lan
ramya marichamy
 
Ad

Recently uploaded (20)

PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PDF
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PDF
Council of Chalcedon Re-Examined
Smiling Lungs
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
PDF
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
PPTX
infertility, types,causes, impact, and management
Ritu480198
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Council of Chalcedon Re-Examined
Smiling Lungs
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
infertility, types,causes, impact, and management
Ritu480198
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
Controller Request and Response in Odoo18
Celine George
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Horarios de distribución de agua en julio
pegazohn1978
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 

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.
  • 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.