nested if-elsif-then Vs case

Joined
Apr 23, 2007
Messages
6
Reaction score
0
Hi.
I had a tutorial assignment to compare the resource and time consumption of an 8-to-3 encoder when using a nested if and case scheme.

after synthesis the results were comparable:

priority encoder

# IOB - 12
# DFF / Latch - 0
# LUT - 8
# Slices - 4
Delay - 12.271 ns

non-priority encoder

# IOB - 12
# DFF / Latch - 0
#LUT - 9
# Slices - 5
Delay - 12.445 ns

from this it seems that the nested if construcition is better when it comes to resource consumption. However, the case code 'looks' better and is easily readable and doesn't require so thorough analysis as the nested if code sometimes does.

Is this a general rule? I mean are the if constructions less 'hungry' but less readable? :)
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top