You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Regstr_space.v 984 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. `timescale 1ns / 1ps
  2. //////////////////////////////////////////////////////////////////////////////////
  3. // Company:
  4. // Engineer:
  5. //
  6. // Create Date: 11.02.2021 11:17:22
  7. // Design Name:
  8. // Module Name: Regstr_space
  9. // Project Name:
  10. // Target Devices:
  11. // Tool Versions:
  12. // Description:
  13. //
  14. // Dependencies:
  15. //
  16. // Revision:
  17. // Revision 0.01 - File Created
  18. // Additional Comments:
  19. //
  20. //////////////////////////////////////////////////////////////////////////////////
  21. module Regstr_space(clk, we, en, addr, di, dout);
  22. input clk;
  23. input we;
  24. input en;
  25. input [17:0] addr;
  26. input [7:0] di;
  27. output [7:0] dout;
  28. reg [7:0] RAM [43:0];
  29. reg [7:0] dout;
  30. always @(posedge clk)
  31. begin
  32. if (en)
  33. begin
  34. $display("====================================== REGISTER SPACE ========================================");
  35. if (we)
  36. RAM[addr] <= di;
  37. else
  38. dout <= RAM[addr];
  39. $display("ADDR = %h\t DATA = %h",addr,di);
  40. end
  41. end
  42. endmodule