The World’s Largest Online Community for Developers

'; How the logical XOR and NOT operations are available in the arithmetic operation of ALU? - LavOzs.Com


For different combinations of selection bits and input carry, we can perform different arithmetic operations as found in this book (Figure 1, given below). Similarly, for different combinations of selection bits, we can perform different logical operations (Figure 2, given below). This book mentioned that two of the logical operations (XOR and NOT) already available (So far I understand from this book and class lecture, they referred that these two operations are available in the arithmetic operations figure). But I did not find any similar operation in arithmetic operation figure.

Basically, I wanted to get the explanation of the highlighted line.

need explanation of the highlighted line

(Picture is from Digital Logic and Computer Design)

What I think after going through class lectures and the referred book

In the arithmetic operations figure, we find one decrement operation (F=A-1). And in this operation, if we give input 1 (A=1), we will get output 0 (F=0). On the otherhand, if we set input 0 (A=0), we will get nonzero value (F=2^n - 1) as an output. And this resembles a logical complement operation. So, maybe they referred this decrement operation as an available operation for NOT operation.

In case of X-OR operation, they maybe referred the arithmetic add (basically OR) operation (F=A+B).

So, What confuses me

When we get input 0 for variable A, we get output 2^n-1 for the decrement function (F=A-1). It (2^n-1) is not equal to 1 which we would get as an output for the logical complement operation. So, how the decrement function (F=A-1) can resemble the logical NOT operation ?

OR operation gives 1 as an output even when all inputs are 1, which is zero regarding X-OR operation. So, OR and X-OR operation are not similar. So, how OR operation can resemble the logical XOR operation?

My Question

How the logical XOR and NOT operations are available in the arithmetic operation? More explicitly, Which operations of arithmetic unit they (i.e. XOR and NOT) resemble and how?

Figure 1: Arithmetic Operations, Collected from Digital Logic and Computer Design

Different Arithmetic Operation

Figure 2: Logical Operations, Collected from Digital Logic and Computer Design

Different Logical Operations

How do you get the logical xor of two variables in Python?
Creating a “logical exclusive or” operator in Java
Logical XOR operator in C++?
Why is there no logical xor in JavaScript?
Simple logical operators in Bash
Exclusive logical sum (XOR)
How to concatenate 3 operation select bits in a 4-bit ALU design - VHDL
Are || and ! operators sufficient to make every possible logical expression?
For how many values of x will n + x = n XOR x when n and x are whole numbers and n>=x?