user2570392
user2570392

Reputation: 3

Set a binary number to input

So I have the input:

input x1,
input x2,
input x3,
input x4,
input x5,
input x6,
input x7,
input x8,

And a variable called

reg [6:0] set_Individual_bits =7'b0000000;

My question is, how can I get the inputs to take the places of the zeros? For instance, how I thought it would work was

set_Individual_bits <= (x2,x3,x4,x5,x6,x7,x8);

However this gives me a syntax error:

"Near text ','; expecting")"

Upvotes: 0

Views: 1001

Answers (1)

Qiu
Qiu

Reputation: 5751

You can use concatenation operator ({}) to achieve what you want:

set_Individual_bits <= {x2,x3,x4,x5,x6,x7,x8};

Upvotes: 3

Related Questions