home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #23 / NN_1992_23.iso / spool / sci / electron / 17087 < prev    next >
Encoding:
Text File  |  1992-10-13  |  1.3 KB  |  34 lines

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