79656263

Date: 2025-06-06 17:25:22
Score: 0.5
Natty:
Report link

I had a similar one shot need, here is a strait forward logic hack to do the trick -- some one write a script to expand for any number bits, I wrote it out for 16 -- example for 4.

You pick what you want in case all bits are zero, I put -1 as a template.

Plus it takes a start bit position to start looking from.

 case (start_bit)
    0: bit = x[0] ? 0 : x[1] ? 1: x[2] ? 2: x[3] ? 3: -1;
    1: bit = x[1] ? 1: x[2] ? 2: x[3] ? 3 : -1;
    2: bit = x[2] ? 2: x[3] ? 3 : -1;
    3: bit = x[3] ? 3 : -1;
endcase 
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: user30739902