Binary And Article Index for
Binary
Website Links For
Binary
 

Information About

Binary And




Likewise, two Bit s may be combined with ''and'':


x y x AND y
0 0 0
0 1 0
1 0 0
1 1 1


I.e. the result is 1, if both x and y are 1, and 0 otherwise. If 0 is equated with ''false'', and 1 with ''true'' the ''bit and'' operation works like our ''logical and''.

''Binary and'' can work on Binary numbers of any size, the numbers are simply ''and''ed digit by digit. For example:

x: 10001101
y: 01010111
x AND y: 00000101

(Only in the first, and third column from the right, both operands had 1 digits.)

''and'' is often called '' Mask ing'', because y can be seen as a mask which is transparent (1) in some places (x will shine through), and black (0) in others (x will be blocked).


SEE ALSO