direction and start stop now working

This commit is contained in:
Imants Pulkstenis
2020-04-13 19:23:11 +03:00
parent 45652812e3
commit 9c73fa1193
4 changed files with 37 additions and 44 deletions
+11 -13
View File
@@ -16,17 +16,15 @@
/////////////////////////////
module flip_flop (
input clk,
input rst,
input t,
output reg q);
always @ (posedge clk) begin
if (!rst)
q <= 0;
else if (t)
q <= ~q;
else
q <= q;
end
input start,
output out);
reg r_out = 1'b0;
always@(posedge start) begin
r_out <= ~r_out;
end
assign out = r_out;
endmodule