Absolute value and two dimensional memory

Status
Not open for further replies.

umerkakli

Newbie level 2
Joined
May 12, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,293
Hi everyone,

I have two questions

1. How to calculate Absolute Value in Verilog (e.g. b=|a|)?
2. How to access single memory location in 2-Dimensional memory? I have 16x16 memory defined as [0:16]mem[0:16] and I want to get value of 3rd column and 4th row?

Looking forward to hear from you soon, thanks in advance.

Regards,
Umar
 

1. assign x_abs = x[LEN-1] ? -x : x;
2. i'm going to assume a geometry, mem[4][3]. This would get the 3rd bit of the 4th word.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…