Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module hamming_coder_nonsystematic_tb();
- logic clk;
- logic reset;
- logic in;
- logic out;
- initial begin
- clk = 0;
- in = 0;
- forever #5 clk = ~clk;
- end
- hamming_coder_nonsystematic uut(clk, reset, in, out);
- initial begin
- // Тест 11111000001
- // Должно кодироваться в x^14+x^13+x^12+x^10+x^6+x^4+x+1 = 11101001010011
- #1 reset = 1; #10
- reset = 0; #10
- in = 1; #10
- in = 1; #10
- in = 1; #10
- in = 1; #10
- in = 1; #10
- in = 0; #10
- in = 0; #10
- in = 0; #10
- in = 0; #10
- in = 0; #10
- in = 1; #10
- in = 0; #10
- in = 0; #10
- in = 0; #10
- in = 0;
- $stop;
- end
- always @(posedge clk)
- #2 $write(out);
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement