Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

The GNU C Programming Tutorial - Truth tables and bit masks

Node:Truth tables and bit masks, Previous:Shift operations, Up:Machine-level operators



Truth tables and bit masks

The binary operators AND (&), OR (inclusive OR, |) and XOR (exclusive OR, also called EOR, ^) perform comparisons, or masking operations, between two bit strings. They are also binary operators in the sense that they take two operands. There is another operator called NOT (~) that is a unary operator; it takes only one operand.

These bitwise operations are best summarized by truth tables. Each truth table for a binary operator (that is, one with two operands), indicates what the result of the operation is for every possible combination of two bits.

 
 
  Published under free license. Design by Interspire