当我测试我的数据流模块时,我所有的输入都是无关紧要的。我不确定问题出在哪里。可能是我的方程式还是我的测试台本身?
这是我的代码。
数据流:
module TollSystem(weekDay,rushHour,lateNight,highTraffic,lowRate,mediumRate,highRate);
input weekDay,rushHour,lateNight,highTraffic;
output lowRate,mediumRate,highRate;
assign #6 lowRate = ~weekDay&~rushHour&lateNight&~highTraffic |
weekDay&~rushHour&lateNight&~highTraffic;
assign #6 mediumRate = (~rushHour&~lateNight&~highTraffic) | (~weekDay&~lateNight&~highTraffic) |
(rushHour&lateNight);
assign #6 highRate = (weekDay&~lateNight&rushHour) |
(~lateNight&highTraffic|~rushHour&lateNight&highTraffic);
endmodule
试验台:
module TollSystemtest();
reg weekDay,rushHour,lateNight,highTraffic;
wire lowRate,mediumRate,highRate;
TollSystem TSys(weekDay,rushHour,lateNight,highTraffic,lowRate,mediumRate,highRate);
initial
begin
weekDay=0;rushHour=0;lateNight=0;highTraffic=0;
weekDay=0;rushHour=0;lateNight=0;highTraffic=1;
weekDay=0;rushHour=0;lateNight=1;highTraffic=0;
weekDay=0;rushHour=0;lateNight=1;highTraffic=1;
weekDay=0;rushHour=1;lateNight=0;highTraffic=0;
weekDay=0;rushHour=1;lateNight=0;highTraffic=1;
weekDay=0;rushHour=1;lateNight=1;highTraffic=0;
weekDay=0;rushHour=1;lateNight=1;highTraffic=1;
weekDay=1;rushHour=0;lateNight=0;highTraffic=0;
weekDay=1;rushHour=0;lateNight=0;highTraffic=1;
weekDay=1;rushHour=0;lateNight=1;highTraffic=0;
weekDay=1;rushHour=0;lateNight=1;highTraffic=1;
weekDay=1;rushHour=1;lateNight=0;highTraffic=0;
weekDay=1;rushHour=1;lateNight=0;highTraffic=1;
weekDay=1;rushHour=1;lateNight=1;highTraffic=0;
weekDay=1;rushHour=1;lateNight=1;highTraffic=1;
$finish();
end
endmodule
输入/输出结果:
[ 1