Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Logical conjunction
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Applications in computer engineering{{anchor|software_AND}}== [[File:AND Gate diagram.svg|thumb|right|AND [[logic gate]]]] In high-level computer programming and [[digital electronics]], logical conjunction is commonly represented by an infix operator, usually as a keyword such as "<code>AND</code>", an algebraic multiplication, or the ampersand symbol <code>&</code> (sometimes doubled as in <code>&&</code>). Many languages also provide [[short-circuit evaluation|short-circuit]] control structures corresponding to logical conjunction. Logical conjunction is often used for bitwise operations, where <code>0</code> corresponds to false and <code>1</code> to true: * <code>0 AND 0</code> = <code>0</code>, * <code>0 AND 1</code> = <code>0</code>, * <code>1 AND 0</code> = <code>0</code>, * <code>1 AND 1</code> = <code>1</code>. The operation can also be applied to two binary [[words]] viewed as [[bitstring]]s of equal length, by taking the bitwise AND of each pair of bits at corresponding positions. For example: * <code>11000110 AND 10100011</code> = <code>10000010</code>. This can be used to select part of a bitstring using a [[Mask (computing)|bit mask]]. For example, <code>1001'''1'''101 AND 0000'''1'''000</code> = <code>0000'''1'''000</code> extracts the fourth bit of an 8-bit bitstring. In [[computer networking]], bit masks are used to derive the network address of a [[subnetwork|subnet]] within an existing network from a given [[IP address]], by ANDing the IP address and the [[subnetwork#Binary subnet masks|subnet mask]]. Logical conjunction "<code>AND</code>" is also used in [[SQL]] operations to form [[database]] queries. The [[Curry–Howard correspondence]] relates logical conjunction to [[product type]]s.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)