module AND2X1(IN1,IN2,OUT); input IN1,IN2; output OUT; and(OUT,IN1,IN2); endmodule module AND2X2(IN1,IN2,OUT); input IN1,IN2; output OUT; and(OUT,IN1,IN2); endmodule module AND2X4(IN1,IN2,OUT); input IN1,IN2; output OUT; and(OUT,IN1,IN2); endmodule module AND3X1(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; and(OUT,IN1,IN2,IN3); endmodule module AND3X2(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; and(OUT,IN1,IN2,IN3); endmodule module AND3X4(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; and(OUT,IN1,IN2,IN3); endmodule module AOIX1(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; nor(OUT,IN3,_n1); and(_n1,IN1,IN2); endmodule module AOIX2(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; nor(OUT,IN3,_n1); and(_n1,IN1,IN2); endmodule module AOIX4(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; nor(OUT,IN3,_n1); and(_n1,IN1,IN2); endmodule module BUFX16(IN,OUT); input IN; output OUT; buf(OUT,IN); endmodule module BUFX32(IN,OUT); input IN; output OUT; buf(OUT,IN); endmodule module BUFX4(IN,OUT); input IN; output OUT; buf(OUT,IN); endmodule module BUFX8(IN,OUT); input IN; output OUT; buf(OUT,IN); endmodule module DECODER_2TO4_AH(OUT_0,OUT_1,OUT_2,OUT_3,SEL_0,SEL_1); input SEL_0,SEL_1; output OUT_0,OUT_1,OUT_2,OUT_3; not(_n1,SEL_0); not(_n2,SEL_1); nor(OUT_0,SEL_0,SEL_1); nor(OUT_2,SEL_0,_n2); nor(OUT_1,SEL_1,_n1); and(OUT_3,SEL_0,SEL_1); endmodule module DECODER_2TO4_AL(OUT_0,OUT_1,OUT_2,OUT_3,SEL_0,SEL_1); input SEL_0,SEL_1; output OUT_0,OUT_1,OUT_2,OUT_3; not(_n1,SEL_0); not(_n2,SEL_1); or(OUT_0,SEL_0,SEL_1); nand(OUT_3,SEL_0,SEL_1); nand(OUT_1,SEL_0,_n2); nand(OUT_2,SEL_1,_n1); endmodule module DECODER_3TO8_AH(OUT\<0\>,OUT\<1\>,OUT\<2\>,OUT\<3\>,OUT\<4\>,OUT\<5\>,OUT\<6\>,OUT\<7\>,SEL\<0\>,SEL\<1\>, SEL\<2\>); input SEL\<0\>,SEL\<1\>,SEL\<2\>; output OUT\<0\>,OUT\<1\>,OUT\<2\>,OUT\<3\>,OUT\<4\>,OUT\<5\>,OUT\<6\>,OUT\<7\>; not(_n6,SEL\<0\>); not(_n7,SEL\<1\>); not(_n1,SEL\<2\>); or(_n5,SEL\<0\>,SEL\<1\>); nor(OUT\<3\>,SEL\<2\>,_n2); nor(OUT\<2\>,SEL\<2\>,_n3); nor(OUT\<1\>,SEL\<2\>,_n4); nor(OUT\<0\>,SEL\<2\>,_n5); nor(OUT\<7\>,_n1,_n2); nor(OUT\<6\>,_n1,_n3); nor(OUT\<5\>,_n1,_n4); nor(OUT\<4\>,_n1,_n5); nand(_n2,SEL\<0\>,SEL\<1\>); nand(_n4,SEL\<0\>,_n7); nand(_n3,SEL\<1\>,_n6); endmodule module DECODER_3TO8_AL(OUT\<0\>,OUT\<1\>,OUT\<2\>,OUT\<3\>,OUT\<4\>,OUT\<5\>,OUT\<6\>,OUT\<7\>,SEL\<0\>,SEL\<1\>, SEL\<2\>); input SEL\<0\>,SEL\<1\>,SEL\<2\>; output OUT\<0\>,OUT\<1\>,OUT\<2\>,OUT\<3\>,OUT\<4\>,OUT\<5\>,OUT\<6\>,OUT\<7\>; not(_n6,SEL\<0\>); not(_n7,SEL\<1\>); not(_n5,SEL\<2\>); nor(_n4,SEL\<0\>,SEL\<1\>); nor(_n2,SEL\<0\>,_n7); nor(_n3,SEL\<1\>,_n6); and(_n1,SEL\<0\>,SEL\<1\>); nand(OUT\<7\>,SEL\<2\>,_n1); nand(OUT\<6\>,SEL\<2\>,_n2); nand(OUT\<5\>,SEL\<2\>,_n3); nand(OUT\<4\>,SEL\<2\>,_n4); nand(OUT\<3\>,_n1,_n5); nand(OUT\<2\>,_n2,_n5); nand(OUT\<1\>,_n3,_n5); nand(OUT\<0\>,_n4,_n5); endmodule module DFF_P_X2(CLK,D,Q,Q_B); input CLK,D; output Q,Q_B; not(Q,Q_B); not(_n1,_n2); mux(Q_B,CLK,_n2,Q_B); imux(_n2,CLK,_n1,D); endmodule module FOUR_NAND2X2(IN_A\<0\>,IN_A\<1\>,IN_A\<2\>,IN_A\<3\>,IN_B\<0\>,IN_B\<1\>,IN_B\<2\>,IN_B\<3\>,OUT\<0\>,OUT\<1\>, OUT\<2\>,OUT\<3\>); input IN_A\<0\>,IN_A\<1\>,IN_A\<2\>,IN_A\<3\>,IN_B\<0\>,IN_B\<1\>,IN_B\<2\>,IN_B\<3\>; output OUT\<0\>,OUT\<1\>,OUT\<2\>,OUT\<3\>; nand(OUT\<0\>,IN_A\<0\>,IN_B\<0\>); nand(OUT\<1\>,IN_A\<1\>,IN_B\<1\>); nand(OUT\<2\>,IN_A\<2\>,IN_B\<2\>); nand(OUT\<3\>,IN_A\<3\>,IN_B\<3\>); endmodule module FOUR_NOR2X2(IN_A\<0\>,IN_A\<1\>,IN_A\<2\>,IN_A\<3\>,IN_B\<0\>,IN_B\<1\>,IN_B\<2\>,IN_B\<3\>,OUT\<0\>,OUT\<1\>, OUT\<2\>,OUT\<3\>); input IN_A\<0\>,IN_A\<1\>,IN_A\<2\>,IN_A\<3\>,IN_B\<0\>,IN_B\<1\>,IN_B\<2\>,IN_B\<3\>; output OUT\<0\>,OUT\<1\>,OUT\<2\>,OUT\<3\>; nor(OUT\<0\>,IN_A\<0\>,IN_B\<0\>); nor(OUT\<1\>,IN_A\<1\>,IN_B\<1\>); nor(OUT\<2\>,IN_A\<2\>,IN_B\<2\>); nor(OUT\<3\>,IN_A\<3\>,IN_B\<3\>); endmodule module INVX1(IN,OUT); input IN; output OUT; not(OUT,IN); endmodule module INVX16(IN,OUT); input IN; output OUT; not(OUT,IN); endmodule module INVX2(IN,OUT); input IN; output OUT; not(OUT,IN); endmodule module INVX24(IN,OUT); input IN; output OUT; not(OUT,IN); endmodule module INVX32(IN,OUT); input IN; output OUT; not(OUT,IN); endmodule module INVX4(IN,OUT); input IN; output OUT; not(OUT,IN); endmodule module INVX8(IN,OUT); input IN; output OUT; not(OUT,IN); endmodule module MUX2X1_NAND_X1(IN0,IN1,OUT,S); input IN0,IN1,S; output OUT; mux(OUT,S,IN1,IN0); endmodule module MUX2X1_NAND_X2(IN0,IN1,OUT,S); input IN0,IN1,S; output OUT; mux(OUT,S,IN1,IN0); endmodule module MUX2X1_NAND_X4(IN0,IN1,OUT,S); input IN0,IN1,S; output OUT; mux(OUT,S,IN1,IN0); endmodule module MUX2X1_PG_X1(IN0,IN1,OUT,S); input IN0,IN1,S; output OUT; mux(OUT,S,IN1,IN0); endmodule module MUX2X1_PG_X2(IN0,IN1,OUT,S); input IN0,IN1,S; output OUT; mux(OUT,S,IN1,IN0); endmodule module MUX2X1_PG_X4(IN0,IN1,OUT,S); input IN0,IN1,S; output OUT; mux(OUT,S,IN1,IN0); endmodule module MUX8X1_NAND_X4(IN\<0\>,IN\<1\>,IN\<2\>,IN\<3\>,IN\<4\>,IN\<5\>,IN\<6\>,IN\<7\>,OUT,SEL\<0\>, SEL\<1\>,SEL\<2\>); input IN\<0\>,IN\<1\>,IN\<2\>,IN\<3\>,IN\<4\>,IN\<5\>,IN\<6\>,IN\<7\>,SEL\<0\>,SEL\<1\>, SEL\<2\>; output OUT; mux(_n3,SEL\<0\>,IN\<1\>,IN\<0\>); mux(_n5,SEL\<0\>,IN\<3\>,IN\<2\>); mux(_n1,SEL\<0\>,IN\<5\>,IN\<4\>); mux(_n4,SEL\<0\>,IN\<7\>,IN\<6\>); mux(_n2,SEL\<1\>,_n4,_n1); mux(_n6,SEL\<1\>,_n5,_n3); mux(OUT,SEL\<2\>,_n2,_n6); endmodule module NAND2X1(IN1,IN2,OUT); input IN1,IN2; output OUT; nand(OUT,IN1,IN2); endmodule module NAND2X2(IN1,IN2,OUT); input IN1,IN2; output OUT; nand(OUT,IN1,IN2); endmodule module NAND2X4(IN1,IN2,OUT); input IN1,IN2; output OUT; nand(OUT,IN1,IN2); endmodule module NAND3X1(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; nand(OUT,IN1,IN2,IN3); endmodule module NAND3X2(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; nand(OUT,IN1,IN2,IN3); endmodule module NAND3X4(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; nand(OUT,IN1,IN2,IN3); endmodule module NOR2X1(IN1,IN2,OUT); input IN1,IN2; output OUT; nor(OUT,IN1,IN2); endmodule module NOR2X2(IN1,IN2,OUT); input IN1,IN2; output OUT; nor(OUT,IN1,IN2); endmodule module NOR2X4(IN1,IN2,OUT); input IN1,IN2; output OUT; nor(OUT,IN1,IN2); endmodule module NOR3X1(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; nor(OUT,IN1,IN2,IN3); endmodule module NOR3X2(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; nor(OUT,IN1,IN2,IN3); endmodule module NOR3X4(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; nor(OUT,IN1,IN2,IN3); endmodule module OAIX1(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; or(_n1,IN1,IN2); nand(OUT,IN3,_n1); endmodule module OAIX2(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; or(_n1,IN1,IN2); nand(OUT,IN3,_n1); endmodule module OAIX4(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; or(_n1,IN1,IN2); nand(OUT,IN3,_n1); endmodule module OR2X1(IN1,IN2,OUT); input IN1,IN2; output OUT; or(OUT,IN1,IN2); endmodule module OR2X2(IN1,IN2,OUT); input IN1,IN2; output OUT; or(OUT,IN1,IN2); endmodule module OR2X4(IN1,IN2,OUT); input IN1,IN2; output OUT; or(OUT,IN1,IN2); endmodule module OR3X1(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; or(OUT,IN1,IN2,IN3); endmodule module OR3X2(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; or(OUT,IN1,IN2,IN3); endmodule module OR3X4(IN1,IN2,IN3,OUT); input IN1,IN2,IN3; output OUT; or(OUT,IN1,IN2,IN3); endmodule module TSINVX1(IN,OUT,TRI,TRI_B); input IN,TRI,TRI_B; output OUT; notif1(OUT,IN,TRI); endmodule module TSINVX1_2(IN,OUT,TRI,TRI_B); input IN,TRI,TRI_B; output OUT; notif1(OUT,IN,TRI); endmodule module TSINVX2(IN,OUT,TRI,TRI_B); input IN,TRI,TRI_B; output OUT; notif1(OUT,IN,TRI); endmodule module XNOR2X1(IN1,IN2,OUT); input IN1,IN2; output OUT; xnor(OUT,IN1,IN2); endmodule module XNOR2X2(IN1,IN2,OUT); input IN1,IN2; output OUT; xnor(OUT,IN1,IN2); endmodule module XNOR2X4(IN1,IN2,OUT); input IN1,IN2; output OUT; xnor(OUT,IN1,IN2); endmodule module XOR2X1(IN1,IN2,OUT); input IN1,IN2; output OUT; xor(OUT,IN1,IN2); endmodule module XOR2X2(IN1,IN2,OUT); input IN1,IN2; output OUT; xor(OUT,IN1,IN2); endmodule module XOR2X4(IN1,IN2,OUT); input IN1,IN2; output OUT; xor(OUT,IN1,IN2); endmodule primitive mux(Y,S,A,B); output Y; input S,A,B; table 1 1 ? : 1; 1 0 ? : 0; 0 ? 1 : 1; 0 ? 0 : 0; ? 1 1 : 1; ? 0 0 : 0; endtable endprimitive primitive imux(Y,S,A,B); output Y; input S,A,B; table 1 1 ? : 0; 1 0 ? : 1; 0 ? 1 : 0; 0 ? 0 : 1; ? 1 1 : 0; ? 0 0 : 1; endtable endprimitive