Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > nested if-elsif-then Vs case

Thread Tools

nested if-elsif-then Vs case

palo palo is offline
Junior Member
Join Date: Apr 2007
Posts: 6
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 by palo; 04-25-2007 at 06:02 PM..
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
case insensitive find on case sensitive stl map C++ 1 04-06-2007 08:42 PM
lower case to upper case Janice C Programming 17 12-14-2004 02:35 PM
how to case select with case-insensitive string ? Tee ASP .Net 3 06-23-2004 07:40 PM
Possible to turn on/off cookieless sessions dynamically on a case by case basis at run-time? Steve Franks ASP .Net 2 06-10-2004 02:04 PM
Scorsese Collection: Keep case vs Snap case Ray DVD Video 0 05-30-2004 04:04 AM