flatten instruction queue using a shift register