View Single Post
  #4   Spotlight this post!  
Unread 02-05-2005, 22:16
Unsung FIRST Hero
Matt Leese Matt Leese is offline
Been-In-FIRST-Too-Long
FRC #1438 (The Aztechs)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1998
Location: Long Beach, CA
Posts: 937
Matt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond repute
Send a message via AIM to Matt Leese
Re: Functions of '?', ':', and '&' in the C programming language

Quote:
Originally Posted by dhoizner
Please pardon my ignorance, but what does the 0x01 do when the bitwise AND is used on it and Tx_Buffer?

Thank you so much for your reply,
The bitwise operators work at the bit level. It will do a bitwise AND on each and every bit. So, if the low-bit of Tx_Buffer is 1, the output will be 1. Otherwise it will be 0.

Assuming Tx_Buffer = 0x41, the comparison would look like:

Code:
    
  0000 0001
& 0100 0001
-----------------
  0000 0001
Matt