Simple verilog question. - are nested loops synthesizable?

Status
Not open for further replies.

adgjl40112

Newbie level 5
Joined
Mar 26, 2010
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,349
Simple verilog question.

Hey guys, I just get a little confused about if it is acceptable to write verilog code like

Code:
reg [3:0] z;

always@(z)
begin
   if (z == 4'd3)
      z = 4'd0;
   else
      z = z;
end

BTW, are nested loops synthesizable?
 

Simple verilog question.

That is acceptable, although i would synthesize into a latch.
For loops are synthesizable.
 

Re: Simple verilog question.

Thx for ur reply.
Still have another question. Is it abnormal that I intend to use latch in the circuit? I am really lack of hardware component.

ANother thing is I use a multidimensional memory to store something.
For eg.
reg[5:0] a[0:5][0:5];
I just want if array any index j of a[1][j] != 5'b00000, then output 1;
else output zero.

How can I achieve this?
 

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