Verilog assign &

Status
Not open for further replies.

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,644
Helped
303
Reputation
608
Reaction score
297
Trophy points
1,363
Activity points
18,302
Hello,

What does this code do?
assign y= & x;
 

'&' is doing a bitwise and operation. i.e. all bits of signal 'x' will be anded with each other and resultant value would be assigned to Y.
 
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
LRM 11.4.9 Reduction operators
I knew what '&'
What I wasn't familiar with is the single line statement.
 

Assignment operations are mostly single line, isn't it?
 

Sorry, I meant "single argument" - not "single line".
In VHDL unary operators weren't possible before 2008, I didn't know Verilog supports it.
 

Verilog has always supported this unary reduction operator, even my book from '93 (pre-IEEE standardization '95) shows it. VHDL has been slowly copying stuff from Verilog over the years.
 
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…