Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to find 1's and 2's complement without using CMA operation in 8085 microprocessor?

Status
Not open for further replies.

Atri Pal

Newbie
Joined
Apr 16, 2021
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
31
In this problem, the given number is located at 8000H location. After finding the 1’s
complement and 2’s complement the result locations are 9000H and 9001H respectively.

address - 8000
data - FD
 

FenTrac

Full Member level 4
Joined
Jul 6, 2014
Messages
234
Helped
47
Reputation
96
Reaction score
48
Trophy points
1,308
Location
West Coast
Activity points
3,741
Subtract FD from FF to get the 1's compliment ( 00000010 ), and add 1 to the 1's complement to get the 2's complement ( 00000011 ).
Uses the add and subtract instructions, but not compare accumulator instruction ( CMA).
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
23,045
Helped
4,716
Reputation
9,448
Reaction score
5,092
Trophy points
1,393
Activity points
152,661
Hi,

A simple internet search gives many results.
BTW: the problrm is not related to 8051 .. it's the same with all processors.

Hints: XOR, INV, COM, ADD, INC, SUB...even a lookup table is possible.

Klaus
 

Atri Pal

Newbie
Joined
Apr 16, 2021
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
31
Subtract FD from FF to get the 1's compliment ( 00000010 ), and add 1 to the 1's complement to get the 2's complement ( 00000011 ).
Uses the add and subtract instructions, but not compare accumulator instruction ( CMA).
Thanks!! It worked!!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top