Explorations of three valued logic in Digital #1100
clifcox
started this conversation in
Show and tell
Replies: 1 comment
-
You are welcome! 😄 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings,
a long time ago I was pushing a few projects along using Logisim, and eventually ran into some problems, and very similar to others experiences, I had to start looking for something new. I'm so happy to have found Digital, though the name does make it a little hard search for. ;-)
Most of my projects are hobby related, and pretty run of the mill. Some explore the edge of what is model-able in a sim. For example, it turns out you can model ternary or three valued logics in Digital, which I think is really... Cool. Here is an example:
In the Wikipedia article they use -1 as one of the values, and we map that to 'Z' in Digital.
Another thing you can do instead of using Z as a logic value is you can use it to represent a Null or missing value. I was trying to find a symbol for that but the closest I got was the empty set {}, or slash-zero, but that's not quite it.. Anyway, some examples:
These gates don't yield a true / false output until enough of their inputs become known values so that the output can be determined. What's more, they are glitch free, if the inputs are. I.e., if the inputs transition from a Z to a 1 or 0, then the outputs will follow suit without any mistakes.
You can then build some adders out of these Z-gates that let you know when the answer is ready. :-)
This kind of behavior is useful in Asynchronous logic, though in typical binary logic circuits they use two or more bits to encode the more than two logic values represented. So for example every gate might have two wires for every input and output. They are not as common, but there are also actual multi-valued logic circuits (MVL) that do use single wires to carry all the values. If you built the above gates out of a MVL architecture, they would behave exactly the same. On the other hand, if you tried to somehow adapt these simple FET proto-circuits to real life, they would probably fail miserably. ;-) I like to focus on the very cool ability to model these three level logic systems, rather than getting hung up on the suggested implementation which is overly simplistic.
The rules of a simulator make or break what can be modeled. When John Conway was working on his game of life, it took him awhile to settle on what rules enabled interesting behavior.
"According to Martin Gardner, Conway experimented with different rules, aiming for rules that would allow for patterns to "apparently" grow without limit..."
Change the rules even a small amount, and the whole Lexicon of Still life's, Oscillators, and Spaceships go away... Not that we live in simulation... Or do we? but... "Life as we know it would be outright impossible if the fine-structure constant had even a slightly different value."
What I'm getting at is, I think it's perfectly fine that tri-stated inputs on gates flicker randomly. It does raise awareness about this common oversight. I also think it's amazingly cool that these simulated switches don't have this noise on them, because then my little garden of unicorn circuits would die on the vine. ;-)
Thanks for a really great project! :-)
Clif
Some relevant links:
https://ieeexplore.ieee.org/document/8067963
https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
https://www.space.com/fine-structure-constant-universe-mystery
https://en.wikipedia.org/wiki/Fine-tuned_universe
Circuits: https://www.eugeneweb.com/~clif/Digital/
Beta Was this translation helpful? Give feedback.
All reactions