adityarajrulz
Newbie level 5
- Joined
- Jun 4, 2012
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Noida, India, India
- Activity points
- 1,345
i have a memory element as : reg [7:0] memory [0:1000] with data fed into the memory after reading from a .bin file .
if i have to read any memory location say
i. location no 3 , then i can do it by writing memory[3] or memory[2'b11]
ii. location no 15 as memory [15] or memory[4'b1111]
but if the memory location is given to me in variables containing each bits. as b1=1 , b2=0, b3= 1 ................
i mean that all the memory location bits is not known to me and is coming to me in some variables as b1,b2,b3,b4......
then how should i refer to that memory location as memory[4'b b1b2b3b4] or memory[4'b b1,b2,b3,b4] is showing syntax error..
WHat is the proper syntax
if i have to read any memory location say
i. location no 3 , then i can do it by writing memory[3] or memory[2'b11]
ii. location no 15 as memory [15] or memory[4'b1111]
but if the memory location is given to me in variables containing each bits. as b1=1 , b2=0, b3= 1 ................
i mean that all the memory location bits is not known to me and is coming to me in some variables as b1,b2,b3,b4......
then how should i refer to that memory location as memory[4'b b1b2b3b4] or memory[4'b b1,b2,b3,b4] is showing syntax error..
WHat is the proper syntax