COA Tutorial
Basic CO and Design
Computer Instructions
Digital Logic Circuits
Map Simplification
Combinational Circuits
Flip - Flops
Digital Components
Register Transfer
Micro-Operations
Memory Organization
COA_Misc
- Booth's Multiplication Algorithm
- Branch Instruction in Computer Organization
- Data Representation in Computer Organization
- ALU and Data Path in Computer Organization
- External memory in Computer Organization
- Structured Computer Organization
- Types of Register in Computer Organization
- Secondary Storage Devices in Computer Organization
- Types of Operands in Computer Organization
- Serial Communication in Computer organization
- Addressing Sequencing in Computer Organization
- Simplified Instructional Computer (SIC)
- Arithmetic Instructions in AVR microcontroller
- Conventional Computing VS Quantum Computing
- Instruction set used in Simplified Instructional Computer
- Branch Instruction in AVR microcontroller
- Conditional Branch instruction in AVR Microcontroller
- Data transfer instruction in AVR microcontroller
- Difference between Memory-based and Register-based addressing modes
- Difference between 1's complement Representation and 2's complement Representation
- CALL Instructions and Stack in AVR Microcontroller
- Difference between Call and Jump Instructions
- Overflow in Arithmetic Addition in Binary number System
- Horizontal Micro-programmed Vs. Vertical Micro-programmed Control Unit
- Hardwired Vs. Micro-programmed Control Unit
- Non-Restoring Division Algorithm for Unsigned Integer
- Restoring Division Algorithm for Unsigned Integer
- Debugging a Machine-level Program
- Dependencies and Data Hazard in pipeline in Computer Organization
- Execution, Stages and Throughput in Pipeline
- Types of Pipeline Delay and Stalling
- Timing Diagram of MOV Instruction
- Advantages and Disadvantages of Flash Memory
- Importance/Need of negative feedback in amplifiers
- Anti-Aliasing - Computer Graphics
- Bus Arbitration in Computer Organization
- Convert a number from Base 2 (Binary) to Base 6
- Cache Coherence
- EHCI
- Cache Memory and Virtual Memory
- Electrical Potential and Potential Difference
- RAM and Cache
- SIM and RIM instructions in 8085 processor
- Clusters in Computer Organization
- Data Types and Addressing Modes of 80386/80386DX Microprocessor
Arithmetic Instructions in AVR microcontroller
In Arithmetic instructions, various types of arithmetic operations are performed with the help of some instruction like multiplication, addition, subtraction, etc. There is no instruction related to the division in the AVR microcontroller, which means AVR cannot perform division operations. There are basically two operands in the AVR microcontroller. These operands are known as registers that are used to hold the data. The destination register (D) is shown with the help of left register or operand, and the source register (S) is shown with the help of right register.
The various types of arithmetic instructions and its explanation are described as follows
Instruction | Operand | Explanation | Example |
---|---|---|---|
ADD | D, S | The ADD instruction is used to add register D (destination register) and the register S (source register). The result of add operation will be stored in register D. The syntax of ADD instruction is described as follows: D = D + S |
ADD D, S |
ADC | D, S | The ADC instruction refers to add with carry. This instruction is used to add the two registers D and S with the contents of C flag. The result of ADC operation will be stored in register D. The syntax of ADC instruction is described as follows: D = D + S + carry |
ADC D, K |
SUB | D, S | The SUB instruction is used to subtract register D (destination register) and register S (source register). The result of subtracting operation will be stored in register D. The syntax of SUB instruction is described as follows: D = D - S |
SUB D, S |
SBC | D, S | The SBC instruction refers to subtract with carry. This instruction is used to subtract the two registers D and S with the C flag. The result of SBC operation will be stored in register D. The syntax of SBC instruction is described as follows: D = D - S - carry |
SBC D, S |
MUL | Unsigned nos. | The MUL instruction is used to multiply the register D (destination register) with register S (source register), and both the registers contain unsigned numbers. The result of product of unsigned numbers will be placed in R0 or R1. The syntax of MUL instruction is described as follows: R1/R0 = D * S R0 = Lower byte of the result R1 = Higher byte of the result |
MUL D, S |
MULS | Signed nos. | The MULS instruction is used to multiply the register D (destination register) with register S (source register), and both the registered contains signed numbers. The result of product of signed numbers will be placed in R0 or R1. The syntax of MULS instruction is described as follows: R1/ R0 = (+/-)D * (+/-)S R0 = Lower byte of the result R1 = Higher byte of the result |
MULS D, S |
MULSU | Signed nos. and unsigned nos. | The MULSU instruction is used to multiply the register D (destination register) with the register S (source register. Here register D is the multiplicand, which contains a signed number, and register S is the multiplier, which contains an unsigned number. The result of product of a signed number and an unsigned number will be placed in R0 or R1. The syntax of MULSU instruction is described as follows: R1/R0 = (+/-)D * S R0 = Lower byte of the result R1 = Higher byte of the result |
MULSU D, S |
INC | D | The INC instruction is used to increase or add the content of register D by 1. The result of increment operation will be stored in the destination register D. The syntax of INC instruction is described as follows: D = D + 1 |
INC D |
DEC | D | The DEC instruction is used to decrease or minus the content of register D by 1. The result of decrement operation will be stored in the destination register D. The syntax of DEC instruction is described as follows: D = D - 1 |
DEC D |