A good way to encode a 1024 one-hot vector into binary?

Discussion in 'VHDL' started by Anthony J Bybell, Jan 28, 2005.

  1. > I have a 1024 one-hot input that I am trying to encode. I've looked at
    > examples converting the 1024 to an unsigned integer, but 2^1024 seems
    > to not be working with the synthesis tool. I'm wondering if anyone has
    > a good loop for encoding a one-hot number without sending the whole
    > thing to an integer.


    You didn't give any design constraints such as combinatorial only, or
    how much latency to get to the result.

    For a simple solution, think of what those bits represent in a
    position sense. Let's try one-hot for 8 bits, the same applies for
    1024:

    01234567
    aaaa enc[2] = v[4] OR v[5] OR v[6] OR v[7]
    bb bb enc[1] = v[2] OR v[3] OR v[6] OR v[7]
    c c c c enc[0] = v[1] OR v[3] OR v[5] OR v[7]

    ....likewise you can nor across the zero bits. 1024 bits to encode is
    quite excessive though. In the very least, even a naive solution
    stepping through each input serially and comparing it to '1' is going
    to burn a lot of gates. Why are you trying to do this?

    -t
    Anthony J Bybell, Jan 28, 2005
    #1
    1. Advertising

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. Ryan
    Replies:
    9
    Views:
    5,106
  2. Tor Erik Sønvisen

    Most efficient way of storing 1024*1024 bits

    Tor Erik Sønvisen, Nov 2, 2005, in forum: Python
    Replies:
    15
    Views:
    511
    Alex Stapleton
    Nov 4, 2005
  3. Replies:
    8
    Views:
    1,890
    Csaba
    Feb 18, 2006
  4. mobi999
    Replies:
    0
    Views:
    743
    mobi999
    Jun 9, 2007
  5. Sandy Miller

    Java EE Developer-HOT HOT OPENINGS

    Sandy Miller, Jan 8, 2008, in forum: Java
    Replies:
    0
    Views:
    354
    Sandy Miller
    Jan 8, 2008
Loading...

Share This Page