home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.electronics
- Path: sparky!uunet!think.com!ames!amdcad!angelo!collin
- From: collin@angelo.amd.com (Collin K. Ong)
- Subject: converting one-hot encoding to binary
- Message-ID: <collin.718996964@angelo>
- Sender: usenet@amd.com (NetNews)
- Nntp-Posting-Host: angelo
- Organization: Advanced Micro Devices, Inc.
- Date: Tue, 13 Oct 1992 17:22:44 GMT
- Lines: 22
-
- I have a string of 64 bits which is one-hot encoded, which means that
- each bit represents one on/off state of one physical unit. I want to
- convert these 64 bits into a single 6 bit representation. The 64 bits
- are stored in a 64 bit circular shift register. The string starts out
- cleared to all 0. Then a string of 0111...1 is loaded into the shift
- register and is shifted around, thus on the next clock, the string
- will be 1011..1, then 11011...1, etc. Thus there is only one bit which
- is 0 at any one time EXCEPT when the registers are cleared to all zeros.
- I want to map the all zero state to 000000, 011111 to 000001, 101111 to
- 000010, etc.
-
- I know this can be done combinationally/with a PLA but I was wondering
- if there was a better way since the number of combinations is limited
- in that there can only be one 0 in the string except in the all zero
- case.
-
- Any suggestions welcome. Thanks.
-
- Collin Ong
- collin@brahms.amd.com
-
-
-