FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > VHDL

VHDL comp.lang.vhdl newsgroup / Usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-28-2005, 06:35 AM
Anthony J Bybell
Guest
 
Posts: n/a
Default A good way to encode a 1024 one-hot vector into binary?

> 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
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A good way to encode a 1024 one-hot vector into binary? Ryan VHDL 9 01-31-2005 03:16 AM
How to add an binary value to a vector? ALuPin VHDL 2 02-05-2004 11:02 AM
Integer or Binary Vector? jk FPGA 0 01-13-2004 07:55 AM


All times are GMT +1. The time now is 03:39 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved