How to declare matrix in verilog

Status
Not open for further replies.

saran86

Newbie level 4
Joined
Jul 17, 2015
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Madurai
Activity points
64
Hi
I'm new to verrilog HDL...I want to write a program for matrix operations in verilog..please help me
 

Hi
I'm new to verrilog HDL...I want to write a program for matrix operations in verilog..please help me

Well first off don't think of Verilog code as a progrm. Verilog isn't a software language. Insstead think in terms of a schematic of a digital circuit, which you will then describe in Verilog.

Now the way you store a matrix is by using a RAM. The address is split into a row and column parts. Anrvthe memory array is defined like so.
Code:
reg [7:0] mem [0:3];
This array would be able to hold a 4x4 matrix of bytes.
 

Oops I meant 2x2 4 entries, that's what I get for posting when tired.

So the memory is divided up as 2 rows of 2 bytes by using address = {col,row};.
 

Oops I meant 2x2 4 entries, that's what I get for posting when tired.

So the memory is divided up as 2 rows of 2 bytes by using address = {col,row};.

Thank you..I will try...
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…