I'm trying to write a XOR operation in assembly language, but the only operations we're allowed to use are AND and NOT, not OR and definitely not XOR. I have looked everywhere online and I can't seem to find the answer. I know: XOR = (P or Q) and ~(P and Q) But I need to rewrite (P or Q) with an AND operation instead. Is this possible?
How to rewrite (P or Q) with AND
1.2k Views Asked by M. Erkan At
1
There are 1 best solutions below
Related Questions in ASSEMBLY
- Is there some way to use printf to print a horizontal list of decrementing hex digits in NASM assembly on Linux
- How to call a C language function from x86 assembly code?
- Binary Bomb Phase 2 - Decoding Assembly
- AVR Assembly Clock Cycle
- Understanding the differences between mov and lea instructions in x86 assembly
- ARM Assembly code is not executing in Vitis IDE
- Which version of ARM does the M1 chip run on?
- Why would %rbp not be equal to the value of %rsp, which is 0x28?
- Move immediate 8-bit value into RSI, RDI, RSP or RBP
- Unable to run get .exe file from assembly NASM
- DOSbox automatically freezes and crashes without any prompt warnings
- Load function written in amd64 assembly into memory and call it
- link.exe unresolved external symbol _mainCRTStartup
- x86 Wrote a boot loader that prints a message to the screen but the characters are completely different to what I expected
- running an imf file using dosbox in parallel to a game
Related Questions in BOOLEAN-LOGIC
- how do we represent the expression x+y'+z' in into one which can be represented using only NANDs (i.e. negations of products)
- LC-3 Assembly OR operation
- I am new to Boolean Algebra, and i need advice
- How do I modify this .hdl chip to fulfill the question's requirements? (boolean logic / nand2tetris)
- How the logical operators works in java?
- My TempArray always has the wrong values and therefore doesnt evaluate properly and I am confused why
- How do I get this code to accommodate any given number by only using boolean logic (no conditionals/ functions)
- Trouble with boolean logic in if (else) statements
- How to make an alert show up when the page won't load AND it's been 7 seconds
- Derive conditions for each variable assignment from pseudocode
- Problems with Drag and Drop system in Unity
- How to output a 5 bit number from a ripple-carry adder/subtractor into a 5 bit decoder to account for overflow in Verilog?
- Most optimal way of running intensive math calculations on a GPU
- What language uses `and` and `or` keywords to mean "do this thing without affecting the result"?
- Change boolean in ajax in ASP.NET MVC
Related Questions in BOOLEAN-EXPRESSION
- QueryDSL BooleanExpression exclude data if the field is null
- Evaluating logical expressions recognized by ANTLR using the System.Linq.Expressions namespace
- What is the most elegant way of checking if multiple objects exist, in Node.js?
- I am new to Boolean Algebra, and i need advice
- How is this (xy)' + (yz) simplified into this (x’+y’)+z in boolean algebra?
- Octave: Boolean AND returns wrong number
- How do I get this code to accommodate any given number by only using boolean logic (no conditionals/ functions)
- Retrieve data based on boolean logic
- Can reification predicates from CLP(FD) be used to check equality of logic expressions?
- Trouble with boolean logic in if (else) statements
- designing a circuit with 3 3-bit inputs and 4 1-bit outputs
- Yacc : Boolean and Arithmetic expression grammars conflict
- Confusion with Boolean Expressions in C / < and > are reversed?
- What is a good way to verify if arguments of a function are numbers
- Reduce if/else-if on a bunch of partially overlapping conditions
Related Questions in BOOLEAN-ALGEBRA
- Understanding John McAfee's note about a seemingly novel, yet simple, anomaly in the XOR operation?
- Generating DIMACS CNF file using bc2cnf is missing AND
- How do I create a simplified logic circuit of this given [(A’B’)’ + (A’+ B’)’]’ ? and What is the simplified Boolean expression?
- Construction of an AND Gate from NOR Gates
- Boolean algebra how to complete missing expressions
- How to represent nested if using OR or AND gates?
- Boolean algebra 2 different simplification?
- How to remove negation in if block?
- Theory for IF statement refactoring?
- Simplify three way comparison a < b < c || b < c < a || c < a < b;
- Any one can solve this: Simplify the boolean expression Z=A+A'B + A'B'C+ A'B'C'D
- Is there a known algorithm for simplifying a boolean expression with number comparisons?
- How to detect overflow after adding multiple binary numbers in 2C?
- Minimization of an expression through K-map, in which there are more chances of errors and with Quine-McCluskey Method there are less chance of errors
- Why does Java Boolean implement Comparable?
Related Questions in DEMORGANS-LAW
- De Morgan to avoid ORs in SQL Server query
- Why, using "and" in a for loop and "or" in a while loop gives the same result?
- Disable button based on string length range
- De Morgan's laws in Bash
- I've read "or" predicates can cause poor SQL server performance, can demorgans save me?
- Why is Q → P a logical consequence of ¬(P → Q )
- DeMorgan's Law Clarification
- How to prove this DeMorgan law without using automation tactics in Coq?
- The missing De Morgan's law
- How does De Morgan's Law work in conditional SQL querying?
- Ruby unless conditional with || operator
- Negation and De Morgan's Law not part of C++20 partial ordering by constraints
- DeMorgans Law unable to simplify a boolean expression
- How to rewrite (P or Q) with AND
- Is !(~A && ~B) better than (A||B) in programming?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
One of De Morgan's laws(a) states that (using
~for negation (not),∧for conjunction (and) and∨for disjunction (or)):In your case or
P ∨ Q,Pis~AandQis~B. So:That right side is therefore the equivalent of
P ∨ Q, using only~and∧operations.(a) And a big thanks for letting me use this knowledge for about the third time since I left University in 1986 :-)