Hi, I am learning perl and having trouble with doing bit manipulation . I want to make all the nibbles 0 lower than the offset and including the current nibble depending on the offset value.
Eg. 1 .if I have a data stream as 0b1111_1111_1111 and Offset is 5 then my output should be 0b1111_0000_0000(making the last and second last nibble 0) 2. if Data= 0b1111_1111_1111 and offset is 3 then my output is 0b1111_1111_0000(making just the last nibble 0)Can someone please suggest a way to do it.
In reply to Making all nibble zero lower than the offset by spriyada29
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |