Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] bit-select or part-select is not allowed in a assign statement for non-net

Status
Not open for further replies.

stackprogramer

Full Member level 3
Full Member level 3
Joined
Jul 22, 2015
Messages
181
Helped
0
Reputation
0
Reaction score
1
Trophy points
1,298
Activity points
2,669
How can I initialize a reg array in Verilog...Any offer?
Code:
reg m_shift_value[3:0];
    initial begin   
          //Initial registers
          assign {m_shift_value[3],m_shift_value[2],m_shift_value[1],m_shift_value[0]} = {0, 32, 64, 96};
      end
 

Why are you using assign statement in an initial block where you should use = ?
How are assigning decimal literals to a bit array that can only take 0 and 1 values?
 
Thanks very much so I concluded that I should use this method for initializing the reg array...
I should use assign for wires...
Code:
initial
          begin
              reg m=0;
            for (k = 0; k < 4 - 1; k = k + 1)
              begin
                  m_shift_value[k] = m;
                  m=m+32;
              end
          end
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top