I often try to think of exercises like this in a completely different
setting. For example, suppose you have ten ordinary playing cards
from a standard deck of 52. You agree that there is a standard
order of these cards where the lowest for this exercise is Ace
of Clubs, then Ace of Diamonds, Ace of Hearts, Ace of Spades, Two
of Clubs, Two of Diamonds, . . . with King of Spades being highest.
Now you're going to flip one card at a time (this is the same
way you get your input, one item per clock cycle). With each
flip you get to make one decision. For example if you only cared
about the highest card of the ten, you could have a single stack
where you place the new card if it is higher than the card already
showing (or if the stack has no cards), and discard any card that
is not higher.
Now my first thought was that you could use this same approach to
find the two highest cards, but there's one case where it doesn't
work - if the highest card comes out first. Then your stack will
only have one card in it so you can't just dig one card down to
find the second highest.
So you need to think how you'd arrange cards to be certain to
know the top two at the end of the exercise. Then it's a simple
matter of translating this procedure to a VHDL process.
Have fun!
--
Gabor