Adnan86
Full Member level 2
Hi, I want to write verilog code for CAM memory. For RAM memory it was easy, just need define ram and i = i+1 in loop to access all address and content. But here i should match data input with data memory,
but I cant find optimize solution to search content at first and then find address.
I mean below code, but this one its not optimize and i dont like to use for loop.
for example data input its 8 bits and depth = 100;
I will appreciate for any advice.
Thanks for your consideration.
but I cant find optimize solution to search content at first and then find address.
I mean below code, but this one its not optimize and i dont like to use for loop.
Code:
for (i =0; i < DEPTH; i+1)
if (data_IN == ram[i]) then
valid = 1; // data input match with data in memory
address = i;
else
valid = 0;
I will appreciate for any advice.
Thanks for your consideration.