anchor.diff:        end
   
         // Prediction
  -      Vector#(32, Bit#(13)) xm;
  -      Vector#(32, Bit#(13)) xn;
  -      for(Integer i = 0; i < 32; i = i + 1) begin
  -         let fac = facTbl[modeX][i];
  -
  -         let t = (fromInteger(fac) * zeroExtend(y[i]));
  -         //xn[i] = zeroExtend(y[i]) * 32 - t;
  -         xn[i] = fromInteger(32 - fac) * zeroExtend(y[i]);
  -         xm[i] = t;
  -      end
  -      sum1 <= xn;
  +      rowd1 <= y;
         
         if (cnt1 != 0) begin
  -         stage1.enq(vec(sum1, xm));
  +         stage1.enq(tuple3(modeX, rowd1, y));
         end
   
         // next row
  
positive.code:       let fac = facTbl[modeX][cnt1];
  
        // Prediction
        Vector#(32, Bit#(13)) xm;
        Vector#(32, Bit#(13)) xn;
        xm[0] = (fromInteger(32 - fac) * zeroExtend(y0[0]));
        xn[0] = (fromInteger(     fac) * zeroExtend(y0[1]));
        for(Integer i = 1; i < 32; i = i + 1) begin
           //xm[i] = (fromInteger(32 - fac) * zeroExtend(y0[i    ]));
           xm[i] = zeroExtend(y0[i]) * 32 - xn[i - 1];
           xn[i] = (fromInteger(     fac) * zeroExtend(y0[i + 1]));
        end
        
        if (cnt1 != 0) begin
           stage1.enq(vec(xm, xn));
        end
  
        // next row
        cnt1 <= cnt1 + 1;
  
negative.code: 
     rule do_stage2;
        let x = stage1.first;
        let modeX = tpl_1(x);
        let y0 = tpl_2(x);
        let y1 = tpl_3(x);
        stage1.deq;
  
        Vector#(32, Bit#(13)) xm;
        Vector#(32, Bit#(13)) xn;
        for(Integer i = 0; i < 32; i = i + 1) begin
           let fac = facTbl[modeX][i];
           xm[i] = (fromInteger(32 - fac) * zeroExtend(y0[i]));
           xn[i] = (fromInteger(     fac) * zeroExtend(y1[i]));
        end
        stage2.enq(vec(xm, xn));
     endrule
  
     rule do_stage3;
        let x = stage2.first;
        Vector#(32, Bit#(8)) y;
        for(Integer i = 0; i < 32; i = i + 1) begin
           y[i] = roundN((x[0][i] + x[1][i]), 5);
  