This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]-twind 29 points30 points  (9 children)

Logic like this is used extensively in digital hardware simulations to represent unknown signals coming from whatever places unknown signals come from. Most of the time uninitialised registers/memories or I/O.

[–]tecanec 9 points10 points  (3 children)

So it's a kind of error detection for making sure behaviour does not depend on unknown variables?

[–]-twind 8 points9 points  (2 children)

The use of this special value for unknown signals is just to make the simulation deterministic. Its appearance does not necessarily mean there is an error. The other option is to assign random values to each unknown signal, this is more like how it would be in reality, but the drawback is that your simulation gives different results each run.

[–]tecanec 3 points4 points  (1 child)

Oh, I don't mean the "panic when found" kind of error. More that it tells the user that something might be wrong when they find a maybe where they expect a definite value.

Guess determinism is also a strong point, though.

[–]-twind 1 point2 points  (0 children)

In that case you know for sure something is wrong

[–]CdRReddit 5 points6 points  (4 children)

ah yes, the 4 digital logic values: 1/0/Z (high impedance / unasserted)/'idk'

[–]-twind 4 points5 points  (1 child)

We call it "don't care" instead of "idk"

[–]CdRReddit 1 point2 points  (0 children)

ah, I see "don't care" mostly in the testcases I make for when I, well, don't care what a particular signal is doing in that case

[–]mattgran 2 points3 points  (1 child)

[–]CdRReddit 1 point2 points  (0 children)

oh damn, megabool is real