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.

blocking assignment in always_comb

Status
Not open for further replies.

stanford

Full Member level 2
Joined
Feb 16, 2014
Messages
132
Helped
4
Reputation
8
Reaction score
6
Trophy points
1,298
Activity points
2,223
1. Are these two code functionally equivalent?

2. Will they synthesize into the same hardware?

Code:
always_comb
  out = 0;
  out = (sel[0]) ? in[0] : out;
  out = (sel[1]) ? in[1] : out;

Code:
assign out = sel[1] ? in[1] : sel[0] ? in[0] : 0;
 

What do you expect?


Most likely, if 1 is true.

Code 1 involves a syntax error.

Are you referring to missing begin/end? I was wondering if they are actually functionally equivalent. I wasn't sure.
 

Assuming the missing begin/end was a typo, they are functionally equivalent and should synthesize to the same hardware. The only difference is in simulation debugging, you'll be able to see the intermediate assignments if you step through the code.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top