I'm working on a program that will take a value in BCD, convert it to binary, and count down for the given value to 0. The BCD conversion module works perfectly, but it seems my 'microwave' module is not being called.
My output of this program is:
time = xxxxxxxx bcdtime = 0001 0010
time = 00001100 bcdtime = 0001 0010
I can see the conversion, but the countdown does not occur. Can anyone explain where I might be going wrong or point me in the direction of resources that could help me answer this? My code is below:
module bcd_to_bin(bintime,bcdtime1,bcdtime0);
input [3:0] bcdtime1,bcdtime0;
output [7:0] bintime;
assign bintime = (bcdtime1 * 4'b1010) + {3'b0, bcdtime0};
endmodule
module microwave(bintimeout, Clk, Start, Stop, bintime, status);
input [7:0] bintime;
input Clk, Start, Stop;
output reg [7:0] bintimeout;
output reg status;
always @ (posedge Start)
begin
assign bintimeout = bintime;
end
always @ (posedge Clk)
begin
bintimeout = bintimeout - 1;
end
endmodule
module t_microwave;
wire status;
wire [7:0] bintimeout;
reg Clk=1; reg Start, Stop;
reg [3:0] bcdtime1, bcdtime0;
wire [7:0] bintime;
microwave M2 (bintimeout, Clk, Start, Stop, bintime, status);
bcd_to_bin M3 (bintime,bcdtime1,bcdtime0);
always #10 Clk = ~Clk;
initial
begin
Start = 0; Stop = 0; bcdtime1 = 4'b0001; bcdtime0 = 4'b0010;
#10 Start = 1; #10 Start = 0;
end
initial #10000 $finish;
initial
begin
$monitor ("time = %b, bcdtime = %b %b ", bintimeout, bcdtime1, bcdtime0);
end
endmodule