C Language

By: Jesse Miller

The C language has six bitwise operators that can be used to perform calculations with binary digits (bits).

The bitwise & AND operator resembles the logical && AND operator in as much that it requires two operands. The logical && operator should not be confused with the bitwise & operator. Unlike the && operator, which only returns a value of either 1 or 0, the bitwise & operator returns a variety of numbers. With bitwise & AND the operator compares each individual bit of a binary number and returns a 1 or 0 for each comparison. The end result is a series of ones and zeros that are converted to their decimal number equivalent. When both compared bit values are 1 a zero and one comparison returns a zero bit value, also comparing two zeros returns a zero bit value. If both bits have a value of 1 the & AND operator returns 1 for that part of the comparison, otherwise it returns 0 for that part. If both the values are 1, the operator returns 1 for that comparison.

The & AND operator continues making comparisons across each pair of bit values until it completes those in the left-hand column. Like the bit wise & AND operator the bitwise OR operator requires two operands. The l OR operator works just like AND operator but produces different results. The bitwise & operator will only return bit value of 1 when both operands are themselves 1, whereas the bitwise I OR operator will return a bit value of 1 if either operand is 1.

The bitwise I operator will only return a bit value of zero when both operands have a value of zero. If both bits have a value of 0 the I or operator returns o for that part of the comparison, otherwise it returns 1 for that part. The I OR operator continues making comparisons across each pair of bit values until it completes the data provided.

Quick Note: Taking the Nonsense out of looking for the right spyware remover

If you really want to take the work out of looking for that right Spyware Protection from a go to the Internet and get a or a Free
Download, In order to prevent your vital information from being ripped from your computer get your Remover Today.

Like the bitwise & AND operator and the bitwise I OR operator the bitwise XOR operator (exclusive OR) also requires two operands. The XOR operator works in a similar way to the OR operator but is subtly different. The bitwise I OR operator will return a bit value of 1 when one or both operands are themselves 1, but the bitwise XOR operator will only return a bit value of 1.

Computers
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 

» More on Computers
 



Share this article :
Click to see more related articles