`timescale 1 ns/1 ns
module ex5_74LS521( A, B, Iab ,Qab_bar);
input Iab;
input [7:0]A,B;
output Qab_bar;
assign Qab_bar = ~ ( (~Iab) &
((~A[0]) ^~ (~B[0])) &
((~A[1]) ^~ (~B[1])) &
((~A[2]) ^~ (~B[2])) &
((~A[3]) ^~ (~B[3])) &
((~A[4]) ^~ (~B[4])) &
((~A[5]) ^~ (~B[5])) &
((~A[6]) ^~ (~B[6])) &
((~A[7]) ^~ (~B[7])) );
endmodule
`timescale 100 ns/1 ns
module testbench;
/*
module ex5_74LS521( A, B, Iab ,Qab_bar);
input Iab;
input [7:0]A,B;
output Qab_bar;
*/
reg [7:0]A,B;
reg Iab;
wire Qab_bar;
ex5_74LS521 UUT( A, B, Iab ,Qab_bar);
initial
begin
A=8'h55 ; B=8'h55; Iab=0;
#20;
A=8'h55 ; B=8'haa; Iab=0;
#20;
A=8'h55 ; B=8'h55; Iab=1;
#20;
A=8'h55 ; B=8'haa; Iab=1;
#20;
$stop;
end
endmodule
沒有留言:
張貼留言