Author Topic: Verilog Assign Logic to Wire Array?  (Read 2194 times)

0 Members and 1 Guest are viewing this topic.

Offline hal9001Topic starter

  • Regular Contributor
  • *
  • Posts: 122
  • Country: 00
Verilog Assign Logic to Wire Array?
« on: December 23, 2023, 07:54:47 am »
I have 3 wire arrays like this
wire [3:0] a;
wire [3:0] b;
wire [3:0] c;

I want c[0]=a[0] & b[0], c[1]=a[1] & b[1], c[2]=a[2] & b[2], c[3]=a[3] & b[3]. Instead of assigning each wire manually is there a one line way to assign the logic?


Cheers!
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11615
  • Country: us
    • Personal site
Re: Verilog Assign Logic to Wire Array?
« Reply #1 on: December 23, 2023, 08:05:49 am »
c = a & b; would do that.
Alex
 
The following users thanked this post: hal9001

Offline hal9001Topic starter

  • Regular Contributor
  • *
  • Posts: 122
  • Country: 00
Re: Verilog Assign Logic to Wire Array?
« Reply #2 on: December 23, 2023, 08:37:55 am »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf