`timescale 1ns/1ns module comparator_4( input [3:0] A , input [3:0] B , output wire Y2 , //A>B output wire Y1 , //A=B output wire Y0 //A<B ); assign {Y2,Y1,Y0} = (A[3]^B[3]) ?//3位不同,判断哪个大 ((A[3])?(3'b100):(3'b001)) ://3位相同,继续判断 ...