What if you keep all the values below 256 and do multiple lookup tables with some simple maths.
ex.
if X<256 then lookup X, [0,...255],duty
if X>255 and X<512 then lookup X-256, [0,...255],duty
if X>511 and X<768 then lookup X-512, [0,...255],duty
if X>767 then lookup X-768, [0,...255],duty
You will loose some resolution in the upper bits, but that is where it doesn't matter for this application.
Bookmarks