Four-valued logic

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In logic, a four-valued logic is any logic with four truth values. Multiple such logics were invented to deal with various practical problems.


Four-valued logic taught in technical schools is used to model signal values in digital circuits: the four values are 1, 0, Z and X. 1 and 0 stand for boolean true and false, Z stands for high impedance or open circuit and X stands for don't care (e.g., the value has no effect). This logic is itself a subset of the 9-valued logic standard of the IEEE called IEEE 1164 and implemented, e.g., in VHDL's std_logic.

Another four-valued logic is Belnap's relevance logic. Its possible values are true, false, both (true and false), and neither (true nor false). Belnap's logic is designed to cope with multiple information sources such that if only true is found then true is assigned, if only false is found then false is assigned, if some sources say true and others say false then both is assigned, and if no information is given by any information source then neither is assigned.

There is also a SAE J1939 standard, used for CAN data transmission in heavy road vehicles, which has four logical (boolean) values: False, True, Error Condition, and Not installed (represented by values 0–3). Error Condition means there is a technical problem obstacling data acquisition. The logics for that is for example True and Error Condition=Error Condition. Not installed is used for a feature that does not exist in this vehicle, and should be disregarded for logical calculation. On CAN, usually fixed data messages are sent containing many signal values each, so a signal representing a not-installed feature will be sent anyway.