bit oprations

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • funblr80
    New Member
    • Nov 2007
    • 1

    #1

    bit oprations

    how to stuff 101 bit in the following integer at the right most side without
    changing other bit in the integer.

    11110010


    ie after changing the integer should be 11110101
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    You need to clear the bits whose value you want to set using a logical AND and then use a logical OR to set the values of those bits.

    Comment

    Working...