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

  1.                           8-BIT PRIORITY ENCODER
  2.  
  3. This is an 8-bit version of the priority encoder in file ENCODER2.PLD,
  4. showing how the general form of the encoder does not change when written
  5. as an indexed equation.
  6.  
  7. | in:Q[7..0], io:A[2..0]
  8. |
  9. | Title:  "8:3 priority encoder"
  10. |
  11. | i=2..0:  n=7..0:  A[i] = Q[7..n]==1 & n[i]
  12.  
  13.  
  14. Since there are only eight input bits, it is practical to test all input
  15. combinations here.
  16.  
  17. | Vectors:
  18. | { Display Q[7..0], " -> ", (A[2..0])d
  19. |   Test    Q[7..0]
  20. |   End }
  21.  
  22.