Advertisement
kekellner

Lab09 - Ej03 - Código y Testbench

Nov 7th, 2021
2,411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module rom (input [3:0] address, output [7:0] data);
  2.  
  3.   reg [7:0] memory [0:15];
  4.  
  5.   initial
  6.     $readmemb("progROM.list", memory);
  7.  
  8.   assign data = memory[address];
  9.  
  10. endmodule
  11.  
  12. /*
  13. module testbench ();
  14.  
  15.     reg [3:0] address;
  16.     wire [7:0] data;
  17.  
  18.     rom U1(address, data);
  19.  
  20.     initial begin
  21.         $monitor("address: %b  data: %b", address, data);
  22.         for (integer i = 0; i < 16; i++) begin
  23.             #1
  24.             address = i;
  25.         end
  26.     end
  27.  
  28. endmodule
  29. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement