siva_7517
Full Member level 2
hi,
I am using ROM for my design. Well, I will generate this using a ROM generator from ARTISAN. Below is an example of a rom coding:
module rom (clk, addr, data);
input clk;
input [1:0] addr;
output [1:0] data;
always @ (posedge clk)
case (addr)
2'b00 : data <=2'b01;
2'b01 : data <=2'b10;
2'b10 : data <=2'b11;
2'b11 : data <=2'b00;
endcase
endmodule
above is the example of the data that i would like to keep in the rom.
Lets say, i am doing some multiplication in my design:
assign A =B*C
If i need the B value from addr 2'b00 from the ROM, how can i do the code in verilog to call the value from the ROM?
Hope anyone can help me on this.
Siva
I am using ROM for my design. Well, I will generate this using a ROM generator from ARTISAN. Below is an example of a rom coding:
module rom (clk, addr, data);
input clk;
input [1:0] addr;
output [1:0] data;
always @ (posedge clk)
case (addr)
2'b00 : data <=2'b01;
2'b01 : data <=2'b10;
2'b10 : data <=2'b11;
2'b11 : data <=2'b00;
endcase
endmodule
above is the example of the data that i would like to keep in the rom.
Lets say, i am doing some multiplication in my design:
assign A =B*C
If i need the B value from addr 2'b00 from the ROM, how can i do the code in verilog to call the value from the ROM?
Hope anyone can help me on this.
Siva