Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Verilog array syntax

Tags:

verilog

I'm new to Verilog, and am having a lot of trouble with it. For example, I want to have an array with eight cells, each of which is 8 bits wide. The following doesn't work:

reg [7:0] transitionTable [0:7];
assign transitionTable[0] = 10;

neither does just doing transitionTable[0] = 10; or transitionTable[0] = 8'h10; Any ideas?

(In case it is not obvious and relevant: I want to make a finite state machine, and specify the state transitions in an array, since that seems easier than a massive case switch.)

like image 316
Xodarap Avatar asked Sep 18 '25 04:09

Xodarap


1 Answers

When using assign you should declare the array as a wire instead of areg.

like image 58
Jan Decaluwe Avatar answered Sep 23 '25 08:09

Jan Decaluwe