Feb 19, 2011 at 8:06pm Feb 19, 2011 at 8:06pm UTC
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 8:07pm UTC
Feb 19, 2011 at 9:22pm Feb 19, 2011 at 9:22pm UTC
...? 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 Feb 19, 2011 at 9:25pm UTC
ANSI and IEEE don't have one -character symbols. I'm just asking a common way to write them.
Feb 19, 2011 at 10:18pm Feb 19, 2011 at 10:18pm UTC
A way I can represent the gates in one character.
Feb 19, 2011 at 10:22pm Feb 19, 2011 at 10:22pm UTC
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 Feb 19, 2011 at 10:50pm UTC
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:33am Feb 20, 2011 at 12:33am UTC
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:36am UTC
Feb 20, 2011 at 12:37pm Feb 20, 2011 at 12:37pm UTC
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 Feb 20, 2011 at 5:53pm UTC
Why ASCII? Why not Unicode?