Continue to Site

# xor linear function and xnor non linear?

Status
Not open for further replies.

#### Abeer_h

##### Member level 5
Hello,

Can anyone help me in understanding how XOR is considered a linear function and XNOR non-linear function?
I did my search and found some answers, but I couldn't fully understand it.

Thanks,
Abeer:twisted:

electro-uae,

Could you post here some reference about that postulation ?
I never hearded that definition.

+++

As far I know, in LFSRs (Linear Feedback Shift Register) the only functions of single bits considered "linear" are XOR and XNOR.

Abeer_h

### Abeer_h

Points: 2
Hi,

Actually, I was reading LFSR design in vhdl when I encountered this fact. I couldn't understad it clearly so I did my search. I found an answer here How does XOR qualify as a linear function?. But I need more explanation.
Thank you guys

Abeer:twisted:

The quoted discussion refers to a very general mathematical field of function theory and linear mappings. If you want to understand XOR in this relation, you would need to get familiar with some theories, I think. If you just want to understand which property of binary logic operations is addressed with "linearity", there's a more simple answer.

It's simply about the fact, that any single change of an input is causing an output change, independant of the (fixed) state of the other input. If you compare all 6 binary operations, you'll see, that this property doesn't apply for AND, OR, NAND, NOR but is valid for XOR - and XNOR as well, as Eduardo stated. So your initial assumption is apparently wrong. Where did you see XNOR qualified "non-linear"?

Points: 2

### jpanhalt

Points: 2
I guess, the Wkipedia author is just jumping into conclusions, based on the fact, that most discussions are about XOR as linear function. Negation should be however considered a linear operation. So if XOR(a,b) is linear, NOT(XOR(a,b) is as well.

Abeer_h

Points: 2