Home »
Embedded Systems
1's and 2's Complement of 8-bit Number in 8085 Microprocessor
In this tutorial, we will learn how to find the 1's and 2's complement of 8-bit number in 8085 Microprocessor?
By Akash Kumar Last updated : May 13, 2023
1's Complement of 8-bit Number
Problem statement
To perform 1's complement of 8-bit number using 8085 microprocessor.
Algorithm
- Load the accumulator with the first data.
- Complement the content of accumulator.
- Now load the result value in memory location.
Program
LDA 2050
CMA
STA 2052
Observation
INPUT:
2050:05
OUTPUT:
2052:FA
Hence, we successfully find the complement of 8-bit number.
2's Complementof 8-bit Number
Problem statement
To perform 2's complement of 8 bit number using 8085 microprocessor.
Algorithm
- Load the accumulator with the first data
- Complement the content of accumulator
- ADD 01 to the content of accumulator
- Now load the result value in memory location
Program
LDA 2050
CMA
ADI 01
STA 2052
Observation
INPUT:
2050:05
OUTPUT:
2052:FB
Hence, we successfully find the 2's complement of 8-bit number.