Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module seq3b (
- input [3:0] i,
- output reg o
- );
- always @(*)
- if (i[0] == i[1] && i[1] == i[2])
- o = 1;
- else if (i[1] == i[2] && i[2] == i[3])
- o = 1;
- else
- o = 0;
- endmodule
- module seq3b_tb;
- reg [3:0] i;
- wire o;
- seq3b seq3b_i (.i(i), .o(o));
- integer k;
- initial begin
- $display("Time\ti\t\to");
- $monitor("%0t\t%b(%2d)\t%b", $time, i, i, o);
- i = 0;
- for (k = 1; k < 16; k = k + 1)
- #10 i = k;
- end
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement