EmbLogic's Blog

comlement of 1′s

why 1′s complement of 1 = -2, not -1 ?

One Response to comlement of 1′s

  1. Abhishek says:

    “~”operator is bitwise compliment operator.
    and negative no. are represented in two’s compliment form.
    e.g. if you took 1, it means in binary 0001
    after complimenting it become 1110, which is two’s compliment reprentation of -2.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>