module sn7485 (A, B, IAGB, IALB, IAEB, QAGB, QALB, QAEB) ;
// Jianjian Song, EC333 October 2000
input [3:0] A ;
input [3:0] B ;
input IAGB ;
input IALB ;
input IAEB ;
output QAGB ;
output QALB ;
output QAEB ;

// add your declarations here
reg	QAGB;
reg	QALB;
reg	QAEB;

always @ (A or B or IAGB or IALB or IAEB)
	begin
	QAGB <= (A>B) || (A==B)&&IAGB || (A==B)&&!(IAGB||IALB||IAEB);
	QALB <= (A<B) || (A==B)&&IALB || (A==B)&&!(IAGB||IALB||IAEB);
	QAEB <= (A==B)&&IAEB;
	end
endmodule