// Name: John M. Acken // Date: 17 March 2006 // Description: decoder inside signature block ECEN 4243 Spring 2006 // // module decoder4sig(ld, gclock, reset0, sel); input[4:0] sel; output reset0, gclock, ld; wire[31:0] min, MAX; wire s4not, s3not, s2not, s1not, s0not; wire turnon, turnoff; INVX1 jma4(.Y(s4not), .A(sel[4])); INVX1 jma3(.Y(s3not), .A(sel[3])); INVX1 jma2(.Y(s2not), .A(sel[2])); INVX1 jma1(.Y(s1not), .A(sel[1])); INVX1 jma0(.Y(s0not), .A(sel[0])); // set minterms. and(min[31], sel[4], sel[3], sel[2], sel[1], sel[0]); and(min[22], sel[4], s3not, sel[2], sel[1], s0not); and(min[16], sel[4], s3not, s2not, s1not, s0not); and(min[8], s4not, sel[3], s2not, s1not, s0not); and(min[2], s4not, s3not, s2not, sel[1], s0not); and(min[1], s4not, s3not, s2not, s1not, sel[0]); and(min[0], s4not, s3not, s2not, s1not, s0not); NAND2X1 rslatch0(.A(turnon), .B(gnot), .Y(gclock)); NAND2X1 rslatch1(.A(turnoff), .B(gclock), .Y(gnot)); nor(turnoff, min[1], min[22]); nor(turnon, min[2], min[16], min[8]); CLKBUF1 loadsig(.Y(ld), .A(min[2])); CLKBUF1 resetsig(.Y(reset0), .A(min[22])); endmodule