MUX implementation in Verilog case statements/ if else statements

Status
Not open for further replies.

santumevce1412

Junior Member level 2
Joined
Jan 8, 2008
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,445
A 4-1 mux written in verilog case statement will be implemented in hardware as .....?
A 4-1 mux written using if else statements in verilog will be implemented in hardware as ...?

My question is both hardware implementation is same or different?

pls explain elaborately......
 

mux implementation

The implementation can be the same or different (depending upon the synth tool).
 
Re: mux implementation

in my opinion, it can be the same or different depend on your writting style.
it have not relation with synthesize tool.
 

Re: mux implementation

It depends upon the exact coding style. I have explained it in detail in one of my MSc reports Please see pages 34,35,36 which explains your doublt very clearly
http://www.vlsiip.com/ipba.pdf
Kr,
Avi
 

Re: mux implementation

avimit said:
It depends upon the exact coding style. I have explained it in detail in one of my MSc reports Please see pages 34,35,36 which explains your doublt very clearly
http://www.vlsiip.com/ipba.pdf
Kr,
Avi
Hmm, I'm not sure page 35 is such a good example. The two bits of code are not equivalent (e.g. consider when more than 1 myvarN is asserted.) What you want to do is compare an if against a casez. (It's no surprise that functionally different code synthesizes to something else, right?)
 

Re: mux implementation


I wanted to exactly highlight the case when only one select line is '1' and rest are '0'. Some ppl would code it using and if-elsif, not konwing that it will result in a priority. That is what I have tried to explain.
I wont use casez or casex as that is not my point.
Kr,
Avi
 

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