home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p078 / 7.img / TUTOR.PLB / GRAYCVT.PLD < prev    next >
Encoding:
Text File  |  1990-12-11  |  768 b   |  19 lines

  1.                       GRAY CODE TO BINARY CONVERTER
  2.  
  3. A Gray code to binary converter is a progressive array of exclusive-or
  4. gates judiciously interconnectely.  Here such a converter is defined as a
  5. numerical map, forcing the PLD compiler to work out the detailed logic
  6. itself.  The PLD compiler achieves exactly the same logic as the classical
  7. exclusive-or array.  See Chapter 5 of the reference guide for a discussion
  8. of maps.
  9.  
  10. |PAL16HD8 in:G[3..0], io:B[3..0]
  11. |
  12. |  Map:  G[3..0] -> B[3..0]  { Gray(n) -> n }
  13.  
  14. | Vectors:
  15. | { Display (G[3..0])d, " = ", G[3..0], " -> ", (B[3..0])d
  16. |   Test     G[3..0]
  17. |   End  }
  18.  
  19.