四位比较器
一,实验目的
通过使用比较四位二进制判断它的相对大小
二,实验内容
四位比较器的实验
三,实验代码
module Comp_2_str(output A_gt_B,A_lt_B,A_eq_B,input A0,A1,B0,B1);
nor (A_gt_B,A_lt_B,A_eq_B);
or (A_It_B,w1,w2,w3);
and (A_eq_B,w4,w5);
and (w1,w6,B1);
and (w2,w6,w7,B0);
and (w3,w7,B0,B1);
not (w6,A1);
not (w7,A0);
xnor (w4,A1,B1);
xnor (w5,AO,BO);
endmodule
module Comp_4_str(
output A_gt_B,A_lt_B,A_eq_B,
input A3,A2,A1,A0,B3,B2,B1,B0);
wire w1,w0;
Comp_2_str M1 (A_gt_B_M1,A_lt_B_M1,A_eq_B_M1,A3,A2,B3,B2);
Comp_2_str M0 (A_gt_B_M0,A_lt_B_M0,A_eq_B_M0,A1,A0,B1,B0);
or (A_gt_B,A_gt_B_M1,w1);
and (w1_eq_B_M1,A_gt_B_M0);
and (A_eq_B,A_eq_B_M1,A_eq_B_M0);
or (A_It_B,A_It_B_M1,w0);
and (w0,A_eq_B_M1,A_lt_B_M0);
endmodule
四,实验截图
五,视频链接
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)