[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: OT : bitmask calculation



PureBytes Links

Trading Reference Links

Don't know how to work it in hex, but the technique I used in
calculating network bitmasks was to write them out in base 2 binary and
AND them manually.  That led to more efficient methods, of course,
largely memorisation.

You COULD do the same thing for this problem, but it would be pretty
labour intensive.  Might give you an insight towards a better way to do
it though.  Maybe just do it for the two end points, take a guess and
test a few intermediate points for assurance.

-----Original Message-----
From: Abhijit Dey [mailto:omegalist@xxxxxxxxxx] 
Sent: Tuesday, 3 May 2005 1:52 AM
To: OmegaList
Subject: OT : bitmask calculation


Nothing to do with trading.. but had to ask.. too many math background 
people here.

I need to calculate a number F and a number M such that,
all numbers (call them A) in the range 0x03C00000 and 0x04200000 would 
satisfy
(F & M) == (A & M)

if a single pair of F and M does not work, multiple pairs would work as 
well.

if you are aware of some resources on the net or otherwise that explains

/ calculates this sort of thing, that would be much appreciated as well.

Thanks,

Abhijit

PS : If you are wondering why I need something weird as that.. well it 
so happens that the above mentioned address range in RAM on one of my 
machines happens to be bad, and I am trying to configure a kernel patch 
that needs the F and M pair(s) as input.