Home »
Embedded Systems
1's and 2's Compliment of 8 bits number in 8085 Microprocessor
Here, we are going to learn how to perform 1's and 2's compliment on 8 bits number in 8085 Microprocessor?
Submitted by Akash Kumar, on October 19, 2018
1's compliment of 8 bits number
Problem statement:
To perform 1'scompliment of 8 bits number using 8085 microprocessor.
Algorithm:
- Load the accumulator with the first data.
- Compliment 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 compliment of 8 bits number.
2's compliment of 8 bits number
Problem statement:
To perform 2'scompliment of 8 bit number using 8085 microprocessor.
Algorithm:
- Load the accumulator with the first data
- Compliment 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 compliment of 8 bits number
TOP Interview Coding Problems/Challenges