Advertisement
Guest User

Untitled

a guest
Mar 29th, 2023
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VeriLog 0.87 KB | Source Code | 0 0
  1. module hamming_coder_nonsystematic_tb();
  2.  
  3.     logic clk;
  4.     logic reset;
  5.     logic in;
  6.     logic out;
  7.    
  8.     initial begin
  9.         clk = 0;
  10.         in = 0;
  11.         forever #5 clk = ~clk;
  12.     end
  13.    
  14.     hamming_coder_nonsystematic uut(clk, reset, in, out);
  15.    
  16.     initial begin
  17.         // Тест 11111000001
  18.         // Должно кодироваться в x^14+x^13+x^12+x^10+x^6+x^4+x+1 = 11101001010011
  19.         #1 reset = 1; #10
  20.         reset = 0; #10
  21.         in = 1; #10
  22.         in = 1; #10
  23.         in = 1; #10
  24.         in = 1; #10
  25.         in = 1; #10
  26.         in = 0; #10
  27.         in = 0; #10
  28.         in = 0; #10
  29.         in = 0; #10
  30.         in = 0; #10
  31.         in = 1; #10
  32.         in = 0; #10
  33.         in = 0; #10
  34.         in = 0; #10
  35.         in = 0;
  36.         $stop;
  37.     end
  38.    
  39.     always @(posedge clk)
  40.         #2 $write(out);
  41. endmodule
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement