W of shift is not a boolean input that means to shift or not to shift, it means wrap or dont wrap, which means to stop at the end or to come back to the beginning. Read the input descriptions. You need to set it up like "if true then shift, if false then do not shift" using f(x) components or logic gate components to say shift or dont shift.