module mslatch (
   d,
   db,
   req,
   rst,
   q,
   qb,
   done
);

   input d;
   input db;
   input req;
   input rst;
   output q;
   output qb;
   output done;
   wire w1;
   wire w2;
   wire w3;
   wire w4;
   wire w5;
   wire w6;
   wire w7;

   IN1 I0 (rst, w7);
   AN21 I1 (d, req, w2, w1);
   AN211 I2 (db, req, w7, w1, w2);
   AN221 I3 (w1, qb, req, qb, w7, q);
   AN22 I4 (w2, q, req, q, qb);
   NA3 I5 (req, w1, db, w3);
   NA2 I6 (w1, q, w4);
   NA2 I7 (qb, w2, w5);
   NA3 I8 (req, w2, d, w6);
   NA4 I9 (w3, w4, w5, w6, done);
endmodule

   
