Showing posts with label Digital Electronics. Show all posts
Showing posts with label Digital Electronics. Show all posts

Tuesday 13 June 2017

COMBINATIONAL CIRCUIT

In digital circuit theory, combinational logic (sometimes also referred to as time-independent logic[1] ) is a type of digital logic which is implemented by Boolean circuits, where the output is a pure function of the present input only. This is in contrast to sequential logic, in which the output depends not only on the present input but also on the history of the input. In other words, sequential logic has memory while combinational logic does not.
Combinational logic is used in computer circuits to perform Boolean algebra on input signals and on stored data. Practical computer circuits normally contain a mixture of combinational and sequential logic. For example, the part of an arithmetic logic unit, or ALU, that does mathematical calculations is constructed using combinational logic. Other circuits used in computers, such as half addersfull addershalf subtractorsfull subtractorsmultiplexersdemultiplexersencoders and decoders are also made by using combinational logic.

Representation

Combinational logic is used to build circuits that produce specified outputs from certain inputs. The construction of combinational logic is generally done using one of two methods: a sum of products, or a product of sums. Consider the following truth table:
ResultLogical equivalent
FFFF
FFTF
FTFF
FTTF
TFFT
TFTF
TTFF
TTTT
Using sum of products, all logical statements which yield true results are summed, giving the result:
Using Boolean algebra, the result simplifies to the following equivalent of the truth table:

Logic formula minimization

Minimization (simplification) of combinational logic formulas is done using the following rules based on the laws of Boolean algebra:
With the use of minimization (sometimes called logic optimization), a simplified logical function or circuit may be arrived upon, and the logic combinational circuit becomes smaller, and easier to analyse, use, or build.

THREE VALUED LOGIC

   In logic, a three-valued logic (also trinary logictrivalentternary, or trilean,sometimes abbreviated 3VL) is any of several many-valued logic systems in which there are three truth values indicating truefalse and some indeterminate third value. This is contrasted with the more commonly known bivalent logics (such as classical sentential or Boolean logic) which provide only for true and false. Conceptual form and basic ideas were initially created by Jan Łukasiewicz and C. I. Lewis. These were then re-formulated by Grigore Moisil in an axiomatic algebraic form, and also extended to n-valued logics in 1945.

Representation of values

As with bivalent logic, truth values in ternary logic may be represented numerically using various representations of the ternary numeral system. A few of the more common examples are:
  • in balanced ternary, each digit has one of 3 values: −1, 0, or +1; these values may also be simplified to −, 0, +, respectively;[1]
  • in the redundant binary representation, each digit can have a value of −1, 0, 0/1 (the value 0/1 has two different representations);
  • in the ternary numeral system, each digit is a trit (trinary digit) having a value of: 0, 1, or 2;
  • in the skew binary number system, only most-significant non-zero digit has a value 2, and the remaining digits have a value of 0 or 1;
  • 1 for true, 2 for false, and 0 for unknownunknowable/undecidableirrelevant, or both;[2][not in citation given]
  • 0 for false, 1 for true, and a third non-integer "maybe" symbol such as ?, #, ½,[3] or xy.
Inside a ternary computer, ternary values are represented by ternary signals.
This article mainly illustrates a system of ternary propositional logic using the truth values {false, unknown, true}, and extends conventional Boolean connectives to a trivalent context. Ternary predicate logics exist as well;[citation needed] these may have readings of the quantifier different from classical (binary) predicate logic and may include alternative quantifiers as well.

Logics

Where Boolean logic has 22 = 4 unary operators, the addition of a third value in ternary logic leads to a total of 33 = 27 distinct operators on a single input value. Similarly, where Boolean logic has 222 = 16 distinct binary operators (operators with 2 inputs), ternary logic has 332 = 19,683 such operators. Where we can easily name a significant fraction of the Boolean operators (notandornandnorexclusive orequivalenceimplication), it is unreasonable to attempt to name all but a small fraction of the possible ternary operators.[4]

Kleene and Priest logics

Below is a set of truth tables showing the logic operations for Kleene's "strong logic of indeterminacy" and Priest's "logic of paradox".
(F, false; U, unknown; T, true)
NOT(A)
A¬A
FT
UU
TF
AND(A, B)
A ∧ BB
FUT
AFFFF
UFUU
TFUT
OR(A, B)
A ∨ BB
FUT
AFFUT
UUUT
TTTT
(−1, false; 0, unknown; +1, true)
NEG(A)
A¬A
−1+1
00
+1−1
MIN(A, B)
A ∧ BB
−10+1
A−1−1−1−1
0−100
+1−10+1
MAX(A, B)
A ∨ BB
−10+1
A−1−10+1
000+1
+1+1+1+1
In these truth tables, the unknown state can be thought of as neither true nor false in Kleene logic, or thought of as both true and false in Priest logic. The difference lies in the definition of tautologies. Where Kleene logic's only designated truth value is T, Priest logic's designated truth values are both T and U. In Kleene logic, the knowledge of whether any particular unknown state secretly represents true or false at any moment in time is not available. However, certain logical operations can yield an unambiguous result, even if they involve at least one unknown operand. For example, since true OR true equals true, and true OR false also equals true, one can infer that true OR unknown equals true, as well. In this example, since either bivalent state could be underlying the unknown state, but either state also yields the same result, a definitive true results in all three cases.
If numeric values, e.g. balanced ternary values, are assigned to falseunknown and true such that false is less than unknown and unknown is less than true, then A AND B AND C... = MIN(A, B, C …) and A OR B OR C … = MAX(A, B, C...).
Material implication for Kleene logic can be defined as:
, and its truth table is
IMPK(A, B), OR(¬A, B)
A → BB
TUF
ATTUF
UTUU
FTTT
IMPK(A, B), MAX(−A, B)
A → BB
+10−1
A+1+10−1
0+100
−1+1+1+1
which differs from that for Łukasiewicz logic (described below).
Kleene logic has no tautologies (valid formulas) because whenever all of the atomic components of a well-formed formula are assigned the value Unknown, the formula itself must also have the value Unknown. (And the only designated truth value for Kleene logic is True.) However, the lack of valid formulas does not mean that it lacks valid arguments and/or inference rules. An argument is semantically valid in Kleene logic if, whenever (for any interpretation/model) all of its premises are True, the conclusion must also be True. (Note that the Logic of Paradox (LP) has the same truth tables as Kleene logic, but it has two designated truth values instead of one; these are: True and Both (the analogue of Unknown), so that LP does have tautologies but it has fewer valid inference rules.)[5]

Łukasiewicz logic[edit]

The Łukasiewicz Ł3 has the same tables for AND, OR, and NOT as the Kleene logic given above, but differs in its definition of implication in that "unknown implies unknown" is true. This section follows the presentation from Malinowski's chapter of the Handbook of the History of Logic, vol 8.[6]
IMPŁ(A, B)
A → BB
TUF
ATTUF
UTTU
FTTT
IMPŁ(A, B)
A → BB
+10−1
A+1+10−1
0+1+10
−1+1+1+1
In fact, using Łukasiewicz's implication and negation, the other usual connectives may be derived as:
  • A ∨ B = (A → B) → B
  • A ∧ B = ¬(¬A ∨ ¬ B)
  • A ↔ B = (A → B) ∧ (B → A)
It's also possible to derive a few other useful unary operators (first derived by Tarski in 1921):
  • MA = ¬A → A
  • LA = ¬M¬A
  • IA = MA ∧ ¬LA
They have the following truth tables:
AMA
FF
UT
TT
ALA
FF
UF
TT
AIA
FF
UT
TF
M is read as "it is not false that..." or in the (unsuccessful) Tarski–Łukasiewicz attempt to axiomatize modal logic using a three-valued logic, "it is possible that..." L is read "it is true that..." or "it is necessary that..." Finally I is read "it is unknown that..." or "it is contingent that..."
In Łukasiewicz's Ł3 the designated value is True, meaning that only a proposition having this value everywhere is considered a tautology. For example, A → A and A ↔ A are tautologies in Ł3 and also in classical logic. Not all tautologies of classical logic lift to Ł3 "as is". For example, the law of excluded middleA ∨ ¬A, and the law of non-contradiction¬(A ∧ ¬A) are not tautologies in Ł3. However, using the operator I defined above, it is possible to state tautologies that are their analogues:

Bochvar logic


Application in SQL Modular algebras

Some 3VL modular algebras have been introduced more recently, motivated by circuit problems rather than philosophical issues:[7]
  • Cohn algebra
  • Pradhan algebra
  • Dubrova and Muzio algebra
The database structural query language SQL implements ternary logic as a means of handling comparisons with NULL field content. The original intent of NULL in SQL was to represent missing data in a database, i.e. the assumption that an actual value exists, but that the value is not currently recorded in the database. SQL uses a common fragment of the Kleene K3 logic, restricted to AND, OR, and NOT tables. In SQL, the intermediate value is intended to be interpreted as UNKNOWN. Explicit comparisons with NULL, including that of another NULL yields UNKNOWN. However this choice of semantics is abandoned for some set operations, e.g. UNION or INTERSECT, where NULLs are treated as equal with each other. Critics assert that this inconsistency deprives SQL of intuitive semantics in its treatment of NULLs.[8] The SQL standard defines an optional feature called F571, which adds some unary operators, among which is IS UNKNOWN corresponding to the Łukasiewicz I in this article. The addition of IS UNKNOWN to the other operators of SQL's three-valued logic makes the SQL three-valued logic functionally complete,[9] meaning its logical operators can express (in combination) any conceivable three-valued logical function.