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?
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: