   Bit-Wise Operations few Problems: need some help
  Hi,I am new to Bit-Wise Operations, if any one could help me with few probs..Bitwise OperatorsA.1. Set the value of an integer equal to 0x1234, “int temp = 0x1234;”2. Clear the lower 4 bits of temp without modifying any of the other bits3. Set bits 1, 5, 7, 8, 9 without modifying any of the other bits4. Shift the contents of temp right by 3 bits5. Shift the contents of temp left by 6 bitsB.1. Create two unsigned chars and give them the values 0xf0, 0x0f, “unsigned char temp1 = 0xf0, temp2 = 0x0f;”2. Create a 16 bit variable with the lower 8 bits set as temp1 and bits 8‐15 set as temp2Bitwise Math Stuff1. Use bitwise operators to multiply by powers of two2. Use bitwise operators to divide by powers of two3. Compute a modulo of a number using bitwise operatorsLogical ThingsCompute a truth table for the following expression using bitwise operatorsA = 0xFAB = 0x10ADC = 0x7D = A’B’C’ + AB + (A’BC’)’ Thanks in Advance!   
  Those look like homework questions, and we're not allowed to give direct answers to those.If you ask a more specific question, and let us know what you tried, then we can help.   ;Quote:Original post by harsh68861. Set the value of an integer equal to 0x1234, “int temp = 0x1234;”2. Clear the lower 4 bits of temp without modifying any of the other bitsDo you know how to clear bits? Do you know what number "lower 4 bits set to 1, rest 0" (or vice versa) is?Quote:Original post by harsh68863. Set bits 1, 5, 7, 8, 9 without modifying any of the other bitsDo you know how to clear bits?Do you know what a bitmask is? Google for the term.   ;  hi,I do agree these are assignment questions but i have no idea how to start...i did try searching the net in order to understand a few things..i did understand how to shift the shift the bits to the right...if u can suggest some tutorial link where in i can have a better idea how to use Bit Wise Operations.Thanks!   ;Bitwise Operators Tutorial. We can't really help more unless you say what you don't understand about bitwise operators.   ;  Homework. Closed. You may repost specific questions provided you show some evidence you've attempted to solve them yourself (such as what you tried, how it failed, what you expected, why you thought it would work, et cetera).   