home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / cad / pcb.arc / EXAMPLE < prev    next >
Text File  |  1989-02-21  |  2KB  |  102 lines

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