- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
E_TOPIC_FOUND: Success
Admin
FTFY
Admin
At least he is not using "untrue" and "unfalse" to indicate Type I and Type II errors. :stuck_out_tongue:
Admin
At the University of Kansas in 1976, basic Boolean logic in the CS/Engineering department was "Yes", "No", and "Don't Care". You'd get dinged in your projects if you didn't properly allow for the "Don't Care" conditions.
Admin
Why have a boolean if you didn't care what it was?
Admin
Because sometimes a variable's value isn't relevant to the solution.
Admin
You have multiple conditions; for some situations, one set of the values are more important than some other condition. In that case, the condition could be yes, or no, but you really DON'T CARE.
Admin
One use case is comparing values. Suppose you have an 8-bit value, and you want to do something if bits 7, 6 and 3 are true, and bit 5 is false. Which is clearer and easier to understand:
x[7] & x[6] & !x[5] & x[3]
or(x & 11101000) == 11001000
orx == 110?1???
?In modern logic design, boolean logic can have 4 values, false, true, and two kinds of "I don't know," typically denoted by the enumerated values
0
,1
,X
andZ
.X
means "I can't figure out what the value is," either because variable was never initialized, or the state is (possibly) invalid, e.g., the logic is powered-down or a timing error occurred that could put a device into a metastable state, or because one of the devices inputs is unknown.Z
is essentially a special kind of unknown that means "no device is driving this signal," which turns into anX
when it goes through any kind of logic gate.Z
s (and the resultingX
s) are expected and often necessary on any kind of half-duplex bi-directional bus (where one device asks another for data, and the other device sends the data back on the same wires) or removable device. (It is possible to avoid theZ
case by pulling the wires to a valid logic level, but at the expense of higher power, which is not acceptable in a lot of applications.)Admin
Yes for instance, if the reset pin on a J-K-flip-flop is pulled low and the set pin is kept high, then the state of the j,k and CP inputs really does not matter, as the state of the output (Q and not-Q) are solely determined by the reset and set pins
Admin
That article was 10 years old last week and is still one of the clbuttics.. I just brought it up in a code review today.
Admin
coughtristatebuffercough
Admin
FILE_NOT_FOUND is a weird name for the hi-z state, though...
Admin
Yeah obvious nonsense. No-one would ever put a third value in a boolean field, like NULL.
Admin
It's important because fully specifying the output for all possible inputs (including illegal ones) can add cost to a project.
Take, for example, a project to design an encoder for rendering decimal digits on a 7-segment LCD (a common homework assignment in beginning digital design classes.) You'll probably start by writing up a truth table that lists all the possible values of the input wires (0..15, because you need 4 wires to represent the numbers 0..9) on separate rows, and a column for each of the display's 7 segments. For each column for rows 0..9, the value can be true (meaning the segment is lit) or false (meaning it is not lit.) But what about rows 10..15? For those, the output columns should be "don't care". The circuit you produce is going to generate some output for those values, but since they're illegal inputs, you don't care about the output.
When you generate the Boolean equations (and the logic-gate circuits) for driving each segment, you can assume either true or false for the don't-care values and should pick the one that minimizes the number of operators (and therefore gates) that will be used. The result will be a circuit that is simpler than what you would get had you specified values for all of the illegal inputs.
This, BTW, is why some early microprocessors had undocumented instructions. These were often the result of don't-care conditions in the processor's design. Usually, these instructions were useless (repeating some other instruction's behavior or crashing or otherwise taking no useful action), but there were occasionally some useful ones. Of course, because they were not part of the design, future optimizations/revisions of the chip would sometimes eliminate or change the behavior of these instructions, so use in software was usually a bad idea.
Admin
Tri-state (and multi-state) logics - of which there are several - can be quite useful, but they are quite different from Boolean logic. Boolean logic in multiple variables can always be substituted for multi-state logics (or any other finite discrete value domain, for that matter), but not fuzzy logics, which are continuous, or quantum logics, which can have superposition. There are definitely cases where having a single inferential value be multi-state is useful, such as in relational calculus, however, and multi-state values are often valuable for encoding information being transmitted across a medium with multiple phases (such as the use of simultaneous amplitude, frequency and phase encodings to increase the effective bandwidth of an optical fiber).
Admin
Pfft.
Modern day SQL has True/False/NULL as possible boolean values.
Admin
Well, if you're dealing with some kind of cascading properties, then any property may be in an "unconfigured" state in addition to a specific value (which could be Boolean). The precise meaning of "unconfigured" would depend on the application - it might mean that a default value (constant or computed) should be used, or that a value should be inherited from a parent object, or it could have some other application-specific meaning.
Whether you would call "unconfigured" a separate value for the property (e.g. a so-called 3-state "boolean") or an independent property is really a meaningless discussion. There are many possible ways to represent the concept in code, all of which (should) have the same effect at the user interface level.
Admin
Are they false dichotomies or are they dichotomies that are neither true nor false?
Admin
It's useful because when you're describing the behaviour of a device that's driving a bus line, you can either force the bus low or force it high, but you can also leave it alone (by switching the transistors that drive it either way off), and when you've got several places that can drive the same place, you only want one of them to drive the bus at a time. (Two things driving it in the same direction wouldn't be too bad I suppose, but two in the opposite directions Would Be Bad, as it would let the magic smoke out, so it's easier to just think in terms of explicitly producing Z.)
Boolean logic is useful in other ways, however, as it was one of the key components of finally working out which were the sound syllogisms, and which were ill-founded. This went a long way towards setting much of what had classically been considered to be philosophy on a surer footing, and in the process it became a field of mathematics. The philosophers went off in a huff to ponder the meanings of intelligence and reality, and promptly achieved nothing much of consequence for a century or more. :smiling_imp:
Admin
Quote from HardwareGeek:
"X means 'I can't figure out what the value is,'..."
No, it doesn't. X means "I don't CARE what the value is." There's a difference. When you're filling in a Karnaugh map to reduce logic, an "X" in a square means the logic can produce either a 1 or 0; doesn't matter. You will KNOW what the value is; it's deterministic. But you don't CARE what it is because it doesn't affect the downstream logic.
Another random observation: we (all of us) have done call-backs to this SOD as "FILE_NOT_FLUND." I only just now noticed that the correct citation is "FileNotFound." /pedant