Applications in Computer Engineering
In high-level computer programming and digital electronics, logical conjunction is commonly represented by an infix operator, usually as a keyword such as "AND
", an algebraic multiplication, or the ampersand symbol "&
". Many languages also provide short-circuit control structures corresponding to logical conjunction.
Logical conjunction is often used for bitwise operations, where 0
corresponds to false and 1
to true:
0 AND 0
=0
,0 AND 1
=0
,1 AND 0
=0
,1 AND 1
=1
.
The operation can also be applied to two binary words viewed as bitstrings of equal length, by taking the bitwise AND of each pair of bits at corresponding positions. For example:
11000110 AND 10100011
=10000010
.
This can be used to select part of a bitstring using a bit mask. For example, 10011101 AND 00001000
= 00001000
extracts the fifth bit of an 8-bit bitstring.
In computer networking, bit masks are used to derive the network address of a subnet within an existing network from a given IP address, by ANDing the IP address and the subnet mask.
Logical conjunction "AND
" is also used in SQL operations to form database queries.
The Curry-Howard correspondence relates logical conjunction to product types.
Read more about this topic: Logical Conjunction
Famous quotes containing the words computer and/or engineering:
“Family life is not a computer program that runs on its own; it needs continual input from everyone.”
—Neil Kurshan (20th century)
“Mining today is an affair of mathematics, of finance, of the latest in engineering skill. Cautious men behind polished desks in San Francisco figure out in advance the amount of metal to a cubic yard, the number of yards washed a day, the cost of each operation. They have no need of grubstakes.”
—Merle Colby, U.S. public relief program (1935-1943)