Case of comparator "="

Discussion in 'VHDL' started by matchstick86, Jan 7, 2010.

  1. matchstick86

    matchstick86

    Joined:
    Oct 2, 2009
    Messages:
    19
    Likes Received:
    0
    Code (Text):

    if a > b then
        bitout <= '1';
    elsif a < b then
        bitout <= '0';
    else
        -- disregard bitout
    end if;
     
    I have a few sets of values for comparison. Because the likelihood of a pair of values being equal is there, I want to discard this result and move onto the next.

    So for example, i have t(7 downto 0), and I compare t(0) with t(1), t(2) with t(3), and so forth till t(6) with t(7). This theoretically should give me a maximum of 4 bits. This process is continuous, so there will be a constant flow of 4 bits. Maybe stored as data(3 downto 0) in a register?

    Now, the problem is, because there is a chance that I will get an "=" case, I would like to disregard that bit. Say, the last bit is discarded such that we have data(2 downto 0) since data(3) is buh-bye. But this data will be incomplete and will create latch (I'm actually making stuff up here. Correct me if I'm wrong).

    So perhaps any guru out there would like to enlighten this lost soul? Danke schoen!
     
    matchstick86, Jan 7, 2010
    #1
    1. Advertisements

  2. matchstick86

    joris

    Joined:
    Jan 29, 2009
    Messages:
    152
    Likes Received:
    0
    I'm not exactly a guru, but yes, if you fail to set bitout to any value in a clocked process, it'll generate a latch (or a flipflop) for it.

    But what's your question really?
    You're describing three cases: less | greater | equal
    you'll need two bits to encode these; which encoding you prefer for this depends on how you look at it; For example:

    "equal bit, greater bit": (what you have, adding an equal indicator)
    less: 00
    greater: 01
    equal: 10

    "greater bit, less bit"
    less: 01
    greater: 10
    equal: 00


    Or, you can consider whether you can have two cases, like:
    greater | less-or-equal
    less | equal-or-greater
     
    joris, Jan 7, 2010
    #2
    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. Steve Franks
    Replies:
    2
    Views:
    1,476
    Steve Franks
    Jun 10, 2004
  2. Tee
    Replies:
    3
    Views:
    8,322
    Herfried K. Wagner [MVP]
    Jun 23, 2004
  3. Janice

    lower case to upper case

    Janice, Dec 10, 2004, in forum: C Programming
    Replies:
    17
    Views:
    1,510
    Richard Bos
    Dec 14, 2004
  4. benhoefer@gmail.com

    case insensitive find on case sensitive stl map

    benhoefer@gmail.com, Apr 6, 2007, in forum: C++
    Replies:
    1
    Views:
    2,798
    Mark P
    Apr 6, 2007
  5. darrel

    'case' vs. 'case is'

    darrel, Aug 14, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    385
    Rory Becker
    Aug 14, 2008
  6. Roedy Green

    Case insensitve Comparator

    Roedy Green, Oct 2, 2009, in forum: Java
    Replies:
    3
    Views:
    362
    Roedy Green
    Oct 2, 2009
  7. Guest
    Replies:
    1
    Views:
    869
    Ken Cox [Microsoft MVP]
    Dec 25, 2004
  8. Lakshmi Narayanan.R

    "Case 1 To 5" in Select case, giving Error!!. Why?

    Lakshmi Narayanan.R, Mar 2, 2005, in forum: ASP General
    Replies:
    10
    Views:
    586
    Bob Barrows [MVP]
    Mar 4, 2005
Loading...