Documente Academic
Documente Profesional
Documente Cultură
Rezolvare:
assign z = ((~x3)&&(~x2)&&(~x1)&&(~x0))||
((~x3)&&(~x2)&&x1&&(~x0))||
((~x3)&&x2&&(~x1)&&(~x0))||
((~x3)&&x2&&(~x1)&&x0)||
((~x3)&&x2&&x1&&x0)||
(x3&&(~x2)&&x1&&x0)||
(x3&&x2&&(~x1)&&x0);
endmodule
Modulul de test:
module test_f;
reg x3t, x2t, x1t, x0t;
wire zt;
initial
begin
#0 {x3t,x2t,x1t,x0t} = 4’d0;
#10 {x3t,x2t,x1t,x0t} = 4’d4;
#10 {x3t,x2t,x1t,x0t} = 4’d9;
#10 {x3t,x2t,x1t,x0t} = 4’d12;
#10 {x3t,x2t,x1t,x0t} = 4’d13;
#10 {x3t,x2t,x1t,x0t} = 4’d15;
..........................................
end
initial
#200 $finish;
endmodule
Rezolvare:
Modulul de test:
module test_dff_reset_load;
reg clkt, resett, loadt, dt;
wire qt;
initial
begin
#0 clkt = 1’b0;
forever #5 clkt = ~clkt;
end
initial
begin
#0 resett = 1’b1; dt = 1’b1; loadt = 1’b0;
#10 resett = 1’b0;
#10 loadt = 1’b1;
…………………………………………..
end
initial
#200 $finish;
endmodule