Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5957461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:24:13+00:00 2026-05-22T18:24:13+00:00

Pretty simple, really. I want to negate an integer which is represented in 2’s

  • 0

Pretty simple, really. I want to negate an integer which is represented in 2’s complement, and to do so, I need to first flip all the bits in the byte. I know this is simple with XOR–just use XOR with a bitmask 11111111. But what about without XOR? (i.e. just AND and OR). Oh, and in this crappy assembly language I’m using, NOT doesn’t exist. So no dice there, either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:24:14+00:00Added an answer on May 22, 2026 at 6:24 pm

    You can’t build a NOT gate out of AND and OR gates.

    As I was asked to explain, here it is nicely formatted. Let’s say you have any number of AND and OR gates. Your inputs are A, 0 and 1. You have six possibilities as you can make three pairs out of three signals (pick one that’s left out) and two gates. Now:

    Operation  Result
    A AND A    A
    A AND 1    A
    A AND 0    0
    A OR A     A
    A OR 1     1
    A OR 0     A
    

    So after you fed any of your signals into the first gate, your new set of signals is still just A, 0 and 1. Therefore any combination of these gates and signals will only get you A, 0 and 1. If your final output is A, then this means that for both values of A it won’t equal !A, if your final output is 0 then A = 0 is such a value that your final value is not !A same for 1.

    Edit: that monotony comment is also correct! Let me repeat here: if you change any of the inputs of AND / OR from 0 to 1 then the output won’t decrease. Therefore if you claim to build a NOT gate then I will change your input from 0 to 1 , your output also can’t decrease but it should — that’s a contradiction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

jsFiddle is here: http://jsfiddle.net/qBQD4/ It's pretty simple really; I want the right arrow to
Pretty simple. What is the difference among those three? I want to list every
Should be pretty simple: I have an InputStream where I want to peek at
I am writing a pretty simple CMS on GAE, and I want my users
Hallo, I'm working on a website which is pretty simple and old. We just
The process is pretty simple -- I want to take an image as input,
I think what I'm trying to do is pretty simple, and I'm really not
Pretty simple scenario. I have a web service that receives a byte array that
Pretty simple question: When i have a persistable object, it usually has a property
Pretty simple question, I'm writing an XML document and i'm not sure how to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.