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 & (sometimes doubled as in &&). 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, 1001
1101 AND 0000
1000 = 0000
1000 extracts the fourth 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. ==Set-theoretic correspondence==