> What is the difference between 2s complement, logical complement and > complement (NOT) and any others? > I am not so hot on the logical operations of PICs and help would be > appreciated. Is there a program which you enter binary numbers and a pic > instruction sequence and you see the results calculator style? Can you also > reccomend any books on binary / boolean logic. > > Thanks > > Tim Ok, you're obviously serious here so.... 2s complement is a way of storing negative numbers. Invert all bits and add one. So. -1 is 0000 0001 -> 1111 1110 -> 1111 1111 (assuming 8 bit) 1s complement is the same except don't add 1. logical complement is the same as 1s complement. i.e. invert all bits. Not is generally boolean in operation. ie. not (1) = 0 not (0) = 1 and not(100) = 0 although it can be confused with logical complement. ( I think in C , not is ! and complement is ^ or ~ or something. Any help? Conor.