home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 373.lha / route_v1.0 / examples / example < prev   
Encoding:
Text File  |  1990-04-25  |  2.1 KB  |  88 lines

  1. ; a circuit for calculating a parity bit for a 16-bit word (an xor tree)
  2. dimension (29,37)
  3.  
  4. ; include necessary part
  5. include pcbinc:ttl7486.inc
  6.  
  7. ; power and ground are supplied here
  8. hole (3,20)
  9. hole (3,25)
  10.  
  11. ; the 16-bit input word
  12. hole (26,5)
  13. hole (26,7)
  14. hole (26,9)
  15. hole (26,11)
  16. hole (26,13)
  17. hole (26,15)
  18. hole (26,17)
  19. hole (26,19)
  20. hole (26,21)
  21. hole (26,23)
  22. hole (26,25)
  23. hole (26,27)
  24. hole (26,29)
  25. hole (26,31)
  26. hole (26,33)
  27. hole (26,35)
  28.  
  29. ; the output (parity) bit
  30. hole (3,11)
  31.  
  32. ; four instances of the above chip
  33. chipat (6,5) name=xor0 type=ttl7486 orientation=normal
  34. chipat (6,21) name=xor1 type=ttl7486 orientation=normal
  35. chipat (16,5) name=xor2 type=ttl7486 orientation=normal
  36. chipat (16,21) name=xor3 type=ttl7486 orientation=normal
  37.  
  38. ; connect power and ground to all chips
  39. priority connect (3,20) and xor0.vcc
  40. priority connect (3,20) and xor1.vcc
  41. priority connect (3,20) and xor2.vcc
  42. priority connect (3,20) and xor3.vcc
  43. priority connect (3,25) and xor0.gnd
  44. priority connect (3,25) and xor1.gnd
  45. priority connect (3,25) and xor2.gnd
  46. priority connect (3,25) and xor3.gnd
  47.  
  48. ; condense 16 bits into 8 bits
  49. connect (26,5) and xor2.a1
  50. connect (26,7) and xor2.b1
  51. connect (26,9) and xor2.a2
  52. connect (26,11) and xor2.b2
  53. connect (26,13) and xor2.a3
  54. connect (26,15) and xor2.b3
  55. connect (26,17) and xor2.a4
  56. connect (26,19) and xor2.b4
  57. connect (26,21) and xor3.a1
  58. connect (26,23) and xor3.b1
  59. connect (26,25) and xor3.a2
  60. connect (26,27) and xor3.b2
  61. connect (26,29) and xor3.a3
  62. connect (26,31) and xor3.b3
  63. connect (26,33) and xor3.a4
  64. connect (26,35) and xor3.b4
  65.  
  66. ; condense 8 bits into 4 bits
  67. connect xor2.y1 and xor1.a1
  68. connect xor2.y2 and xor1.b1
  69. connect xor2.y3 and xor1.a2
  70. connect xor2.y4 and xor1.b2
  71. connect xor3.y1 and xor1.a3
  72. connect xor3.y2 and xor1.b3
  73. connect xor3.y3 and xor1.a4
  74. connect xor3.y4 and xor1.b4
  75.  
  76. ; condense 4 bits into 2 bits
  77. connect xor1.y1 and xor0.a1
  78. connect xor1.y2 and xor0.b1
  79. connect xor1.y3 and xor0.a2
  80. connect xor1.y4 and xor0.b2
  81.  
  82. ; condense 2 bits into 1 bit
  83. connect xor0.y1 and xor0.a3
  84. connect xor0.y2 and xor0.b3
  85.  
  86. ; connect the output (parity) bit
  87. priority connect xor0.y3 and (3,11)
  88.