The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 10:23am
Pages: 1
Send Topic Print
Arrays in verilog (Read 3757 times)
akhil
New Member
*
Offline



Posts: 9

Arrays in verilog
Mar 05th, 2010, 9:37pm
 
Can we use double dimensional arrays in verilog ..
if so how ?
Back to top
 
 
View Profile   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: Arrays in verilog
Reply #1 - Mar 6th, 2010, 2:31am
 
Quote:
`define  Nrow    4
`define  Ncol     3

integer aaa[0:`Nrow*`Ncol-1];

"aaa[i][j]" can be accessed as "aaa[`Ncol*i+j], 0<=i<=`Nrow-1, 0<=j<=`Ncol-1".
Back to top
 
 
View Profile WWW Top+Secret Top+Secret   IP Logged
akhil
New Member
*
Offline



Posts: 9

Re: Arrays in verilog
Reply #2 - Mar 6th, 2010, 7:31am
 
Can we have double dimensional input output ports...
Back to top
 
 
View Profile   IP Logged
akhil
New Member
*
Offline



Posts: 9

Re: Arrays in verilog
Reply #3 - Mar 6th, 2010, 7:54am
 
cud u xplain the above post...as i am a beginner ...i can see only 1 dimensional array
Back to top
 
 
View Profile   IP Logged
akhil
New Member
*
Offline



Posts: 9

Re: Arrays in verilog
Reply #4 - Mar 6th, 2010, 10:03am
 
Actually i wanted to design 64 bit prefix adders..so while writing the verilog code i wrote
output [63:0] c [1:0] ;
as i wanted to store 64 propagate and generate functions ...i.e for each bit i would store the G and P ...
but it was throwing up error during compilatio


Secondly , can i get some web link where i can find  more about prefix adders in terms of verilog code not the description part
Back to top
 
 
View Profile   IP Logged
Marq Kole
Senior Member
****
Offline

Hmmm. That's
weird...

Posts: 122
Eindhoven, The Netherlands
Re: Arrays in verilog
Reply #5 - Mar 8th, 2010, 7:02am
 
As far as I know Verilog IEEE 1364-2008 only supports one-dimensional arrays. SystemVerilog IEEE 1800-2009 does have multi-dimensional array support.

Cheers,
Marq
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.