<p>You ask whether your proposed representation would be acceptable. Offhand, I would be cautious about infix notation for these negative operators.</p>
<p>In English, <code>A NOR B</code> would be expressed as &quot;neither A nor B&quot;. <code>A NAND B</code> would be expressed as &quot;not A and B&quot;. Often, intensifiers will also be prefixed to emphasise a NAND or NOR case and clarify the scope of the negative, such as &quot;not both A and B&quot;, or &quot;not any of A or B&quot;.</p>
<p>In both cases, the negative is introduced first in English, before the list of items, which accords more closely with the structure of the representations you are trying to replace - <code>NOT(A OR B)</code> etc..</p>
<p>Even on a technical front, I'm not familiar with a programming language that has NOR or NAND infix operators.</p>
<p>If you must contract these expressions or use the name of the operator, I would suggest <code>NOR(A,B)</code> and <code>NAND(A,B)</code>.</p>
<p>Another problem is when there are more than two inputs. Unlike AND and OR, NAND and NOR are not associative, whereas &quot;nor&quot; in English has the same meaning and associative property as &quot;or&quot; (it's the introducing word &quot;neither&quot; which applies negation to the whole set, after they have been ORed together).</p>
<p>So <code>NOT(A OR B OR C)</code> corresponds to the English &quot;neither A nor B nor C&quot; (i.e. none of the set is true), but that is not the same as <code>A NOR B NOR C</code> (the meaning of which I can't mentally parse into English, and I'd have to sit down and write out a truth table to be sure).</p>
<p>Nand, of course, does not exist as an English word, but <code>A NAND B NAND C</code> is equally different from &quot;not A and B and C&quot; in English (i.e. not all of the set is true) and from <code>NOT(A AND B AND C)</code> formally.</p>

CC BY-SA 4.0
2020-12-12T09:49:33.003Z
2020-12-12T09:55:53.960Z
2020-12-12T09:55:53.960Z
Steve
<p>I'd use pictures. These have formal standards. Then annotate the pictures with notation.<a href="https://i.sstatic.net/Dz7JL.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Dz7JL.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2020-12-16T18:41:11.577Z
2020-12-16T18:41:11.577Z
Jon Guiton
<p>I am teaching logic gates. I would like to know if anyone knows if there are any conventions for writing combinations of logic gate functions. For example</p>
<pre><code>NOR  gate =&gt; NOT (A OR B)
NAND  gate =&gt;  NOT (A AND B)
</code></pre>
<p>Would it be acceptable to represent the above functions as</p>
<pre><code>NOR  gate =&gt; NOT (A OR B)  as A NOR B
NAND  gate =&gt;  NOT (A AND B) as A NAND B ?
</code></pre>

CC BY-SA 4.0
2020-12-15T06:43:43.283Z
Are you teaching from a specific textbook? (If so: look closely and follow that notation. It varies by book.)
Daniel R. Collins
CC BY-SA 4.0
2020-12-17T05:58:55.017Z
Yes, our reference textbook writes the logic notation as A NOR B and A NAND B.
Reagan Ochora
CC BY-SA 4.0
2020-12-17T06:01:08.247Z
Then I do think you should follow that same convention. I've seen it other books, too.
Daniel R. Collins
<lesson-ideas><computational-thinking>
Are there any conventions for writing logic statements for combinations of logic gate functions?
# Are there any conventions for writing logic statements for combinations of logic gate functions?

(Asked by: username_0 on 2020-12-12)

I am teaching logic gates. I would like to know if anyone knows if there are any conventions for writing combinations of logic gate functions. For example
NOR  gate => NOT (A OR B)
NAND  gate =>  NOT (A AND B)

Would it be acceptable to represent the above functions as
NOR  gate => NOT (A OR B)  as A NOR B
NAND  gate =>  NOT (A AND B) as A NAND B ?

**Tags:** lesson-ideas, computational-thinking

> **Comments:**
> **username_1**: Are you teaching from a specific textbook? (If so: look closely and follow that notation. It varies by book.)  
> **username_0**: Yes, our reference textbook writes the logic notation as A NOR B and A NAND B.  
> **username_1**: Then I do think you should follow that same convention. I've seen it other books, too.  

---

## 2 answers

### Answer by username_2 on 2020-12-12. Score: 2

You ask whether your proposed representation would be acceptable. Offhand, I would be cautious about infix notation for these negative operators.

In English, `A NOR B` would be expressed as "neither A nor B". `A NAND B` would be expressed as "not A and B". Often, intensifiers will also be prefixed to emphasise a NAND or NOR case and clarify the scope of the negative, such as "not both A and B", or "not any of A or B".

In both cases, the negative is introduced first in English, before the list of items, which accords more closely with the structure of the representations you are trying to replace - `NOT(A OR B)` etc..

Even on a technical front, I'm not familiar with a programming language that has NOR or NAND infix operators.

If you must contract these expressions or use the name of the operator, I would suggest `NOR(A,B)` and `NAND(A,B)`.

Another problem is when there are more than two inputs. Unlike AND and OR, NAND and NOR are not associative, whereas "nor" in English has the same meaning and associative property as "or" (it's the introducing word "neither" which applies negation to the whole set, after they have been ORed together).

So `NOT(A OR B OR C)` corresponds to the English "neither A nor B nor C" (i.e. none of the set is true), but that is not the same as `A NOR B NOR C` (the meaning of which I can't mentally parse into English, and I'd have to sit down and write out a truth table to be sure).

Nand, of course, does not exist as an English word, but `A NAND B NAND C` is equally different from "not A and B and C" in English (i.e. not all of the set is true) and from `NOT(A AND B AND C)` formally.


---

### Answer by username_3 on 2020-12-16. Score: 1

I'd use pictures. These have formal standards. Then annotate the pictures with notation.[![enter image description here](https://i.sstatic.net/Dz7JL.png)](https://i.sstatic.net/Dz7JL.png)


---

