In C,
I have a 32bit word representing an address (and I have it stored in a unsigned long, hope thats ok). Now from what I gather, part of an address ...
How to extract the value represented by a particular set of bits in a given number i.e. if bits 11,12 & 13 are 1,1,0 then the value should be 6.
What is ...
I have a 32-bit unsigned int and I need to extract bits at given positions and make a new number out of those bits. For example, if I have a 0xFFFFFFFF ...
Hi guys, I'm currenty writing a program to simulate page replacement, and I'm given a series of virtual addresses in the form of: 0x6873 0x6cff 0x68ec 0xb148 I'm currently going to check to see if the v-address is in the TLB (translation look aside buffer) and if its not in there I'm going to check to see if its in the ...
Hi all, I have some images for which the pixel data was stored as 16 bit unsigned shorts. However, only the first 12 bits have actual data in them, the last 4 can be zero or garbage. How can I extract the first 12 meaningful bits to get what the actual pixel value was? Thanks.
What's the best way to extract the value of the most significant bit (sign bit in 2's complement) integer? I saw a forloop where the person looped to the 32nd bit and returned the value but this takes O(n) time. Anything faster? What if you were to shift the bits 31 places to the right using the bitwise >>? I'm asking ...
Hello, I recently wrote an algorithm that will extract (or atleast try to) X number of bits from a buffer. But, for some reason it doesn't seem to work all the time. For example, it can extract the bits the first time I run my algorithm, but not after that...I figure it's a problem with the way I am storing the ...