OpenCores
URL https://opencores.org/ocsvn/qaz_libs/qaz_libs/trunk

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [basal/] [src/] [RAM/] [write_mixed_width_ram.sv] - Rev 36

Go to most recent revision | Compare with Previous | Blame | View Log

module 
  write_mixed_width_ram // 1024x8 write and 256x32 read
  (
    input [7:0] waddr,
    input [31:0] wdata,
    input we, clk,
    input [9:0] raddr,
    output logic [7:0] q
  );
  logic [3:0][7:0] ram[0:255];
  always_ff@(posedge clk)
  begin
    if(we) 
      ram[waddr / 4][waddr % 4] <= wdata;
    q <= ram[raddr];
  end
endmodule

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.