bit tricks trst
bit calculation changes for shift register edu