nested if-elsif-then Vs case

Discussion in 'VHDL' started by palo, Apr 25, 2007.

  1. palo

    palo

    Joined:
    Apr 23, 2007
    Messages:
    6
    Likes Received:
    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: Apr 25, 2007
    palo, Apr 25, 2007
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. unexpected

    Avoiding if..elsif statements

    unexpected, Aug 25, 2006, in forum: Python
    Replies:
    11
    Views:
    802
    Tal Einat
    Aug 27, 2006
  2. michaelb
    Replies:
    0
    Views:
    579
    michaelb
    Sep 30, 2006
  3. karlwijk

    if/elsif problem

    karlwijk, Apr 16, 2007, in forum: VHDL
    Replies:
    3
    Views:
    785
    quantum_dot
    Apr 18, 2007
  4. Brad Smallridge

    one hot machine without elsif

    Brad Smallridge, Feb 16, 2009, in forum: VHDL
    Replies:
    10
    Views:
    987
  5. apalopohapa
    Replies:
    0
    Views:
    661
    apalopohapa
    Oct 20, 2009
  6. BodiKlamph@gmail.com

    Help. SessionID is x then y then x then y

    BodiKlamph@gmail.com, Sep 3, 2005, in forum: ASP General
    Replies:
    0
    Views:
    565
    BodiKlamph@gmail.com
    Sep 3, 2005
  7. Just Another Victim of the Ambient Morality

    Small gripe about elsif...

    Just Another Victim of the Ambient Morality, Jun 11, 2006, in forum: Ruby
    Replies:
    4
    Views:
    158
    Just Another Victim of the Ambient Morality
    Jun 12, 2006
  8. 7stud 7stud

    elseif v. elsif ??

    7stud 7stud, Mar 7, 2007, in forum: Ruby
    Replies:
    83
    Views:
    1,388
    Samantha
    Mar 13, 2007
Loading...