changed internal state to 3 shiftregs
use of hex_to_bit and vv functions for endianess