2008年11月17日 星期一

11/17 2-bit比較器

module Compare_2_str( A_lt_B , A_gt_B , A_eg_B , A0 , A1 , B0 , B1 );
input A0 , A1 , B0 , B1;
output A_lt_B , A_gt_B , A_eg_B;
wire w1 ,w2 , w3 , w4 , w5 , w6 , w7;

or ( A_lt_B , w1 , w2 , w3 );
nor ( A_lt_B , A_gt_B , A_eg_B );
and ( A_eg_B , w4 , w5 );
and ( w1 , w6 , B1 );
and ( w2 , w6 , w7 , B0);
and ( w3 , w7 , B1 , B0 );
not ( w6 , A1 );
not ( w7 , A0 );
xnor ( w4 , A1 , B1 );
xnor ( w5 , A0 , B0 );
endmodule

沒有留言: