Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

1101 -> 0010 ?

Status
Not open for further replies.

TipGiver

Programmer
Sep 1, 2005
1,863
I have this: 1101 and i want to get this: 0010. I don't know the right word... All i need is to get the reversed number. Also need to get the 0011, which is reversed(1101) + 1 at binary.


Did you understand me?
Tnx
 
It isn't reversed, it's inverted.

If it was reversed it would be 1011.

What processor are you using?
 
yes invert the bits.
This is also the result of the logical not.

it is z80.
 
If you are using a Z80 (of immortal memory), then the instruction to complement the accumulator is CPL.

This gives you the one's complement of the accumulator.

NEG performs a two's complement of the accumulator.
(This is a one's complement with one added to the result).

I have just found a really ancient (83/84) zilog databook...
 
And in some processors the simple inversion would be carried out as an exclusive or with 1111.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top