Symbols for Logic Gates

Feb 19, 2011 at 8:06pm
What are the standard ASCII one-character symbols for NOT, AND, OR, XOR, NAND, NOR, XNOR.
Last edited on Feb 19, 2011 at 8:07pm
Feb 19, 2011 at 9:22pm
...? ASCII has one-character symbols for logic gates? Are you sure you don't mean ANSI/IEEE or something?
Feb 19, 2011 at 9:25pm
ANSI and IEEE don't have one-character symbols. I'm just asking a common way to write them.
Feb 19, 2011 at 10:11pm
What do you mean by one character symbols? Are you referring to these? http://en.wikipedia.org/wiki/Logic_gate
Feb 19, 2011 at 10:18pm
A way I can represent the gates in one character.
Feb 19, 2011 at 10:22pm
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?
Feb 19, 2011 at 10:50pm
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.
Feb 20, 2011 at 12:29am
&abc wold mean c = a AND b.


You have a twisted definition of 'nice'........
Feb 20, 2011 at 12:33am
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 Feb 20, 2011 at 12:36am
Feb 20, 2011 at 12:38am
+1 PiMaster
Feb 20, 2011 at 12:37pm
Anyone that has worked with C or any language that has similar syntax to C will certainly be able to recognise it.
Feb 20, 2011 at 5:53pm
Why ASCII? Why not Unicode?
Topic archived. No new replies allowed.