×

Embedded Systems Tutorial

AVR Microcontroller

8051 Microcontroller

8085 Microprocessor

8086 Microprocessor

8255 Microprocessor

Embedded Systems Practice

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

  1. Load the accumulator with the first data.
  2. Complement the content of accumulator.
  3. 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

  1. Load the accumulator with the first data
  2. Complement the content of accumulator
  3. ADD 01 to the content of accumulator
  4. 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.




Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.