[SOLVED] Reduction operator on a multi dimension vector

Status
Not open for further replies.

rahdirs

Advanced Member level 1
Joined
May 22, 2013
Messages
424
Helped
93
Reputation
192
Reaction score
91
Trophy points
1,308
Location
Mordor
Activity points
4,492
Hi,

I had a basic question, as in what would be the dimension of the o/p after performing a reduction operator on a multidimension vector ?

Sippose I have a vector,


Code Verilog - [expand]
1
logic [1:0] test [5:0];



Would |test give a 2 bit o/p ? or would it also do a bit wise OR of all bits to give a single bit ?
 

The Verilog bit reduction operator is only allowed with integral (packed) bits; |test is illegal.
The SystemVerilog or reduction method would perform a bitwise or with each element.

test.or() is equivalent to test[0] | test[1] |... | test[4] and the result is a 2-bits.

|test.or() results in a single bit.
 

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