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

  1.                                 PIXEL CONVERTER
  2.  
  3. This map generates logic to compute the number of one-bits in an input
  4. word.  Such logic can be used, for example, in a real-time converter from
  5. a 2x2 grid of single-intensity, high-resolution pixels arriving from
  6. remote sensing apparatus to a multiple-intensity, lower-resolution pixel
  7. for a color display screen.
  8.  
  9. No actual devices is assigned, so this corresponds to a trial run to see
  10. how many product terms are required before an actual device is assigned.
  11.  
  12. | io:(HIGHRES[1..4], LOWRES[2..0])
  13. |
  14. | Map:  HIGHRES[1..4] -> LOWRES[2..0]  { n -> bitcount(n) }
  15. |
  16. | Vectors:
  17. | { Display HIGHRES[1..4], " has ", (LOWRES[2..0])d, " bit(s) set"
  18. |   Test    HIGHRES[1..4]
  19. |   End }
  20.  
  21.