Symbols for Logic Gates

What are the standard ASCII one-character symbols for NOT, AND, OR, XOR, NAND, NOR, XNOR.
Last edited on
...? ASCII has one-character symbols for logic gates? Are you sure you don't mean ANSI/IEEE or something?
ANSI and IEEE don't have one-character symbols. I'm just asking a common way to write them.
What do you mean by one character symbols? Are you referring to these? http://en.wikipedia.org/wiki/Logic_gate
A way I can represent the gates in one character.
You need to clarify further. There is no ASCII symbol to represent each of the gates. Are you trying to output these symbols to the console? What exactly are you trying to do?
I'm trying to get a nice way to store them in memory. For example, &abc wold mean c = a AND b. There aren't any convenient "or" symbols, however.

I guess I shouldn't have said "standard"; I mean just something people would recognize.
&abc wold mean c = a AND b.


You have a twisted definition of 'nice'........
You could combine the C++ boolean operators:

1
2
3
4
5
6
7
a | b = a or b
a !| b = a nor b
a & b = a and b
a !& b = a nand b
a ^ b = a xor b
a !^ b = a xnor b
!a = not a

There's no guarantee that the average person would recognize it, but programmers should be able to.
Last edited on
+1 PiMaster
Anyone that has worked with C or any language that has similar syntax to C will certainly be able to recognise it.
Why ASCII? Why not Unicode?
Topic archived. No new replies allowed.