Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.29 KB | None | 0 0
  1. //: version "1.8.7"
  2.  
  3. module JK_flipflop(Reset, J, Clock, Q, K);
  4. //: interface /sz:(40, 40) /bd:[ ]
  5. output Q; //: /sn:0 /dp:1 {0}(458,-4)(458,-2){1}
  6. //: {2}(456,0)(364,0)(364,84)(378,84){3}
  7. //: {4}(458,2)(458,14){5}
  8. //: {6}(460,16)(517,16){7}
  9. //: {8}(521,16)(577,16)(577,6)(587,6){9}
  10. //: {10}(519,18)(519,236)(-136,236)(-136,72)(-68,72){11}
  11. //: {12}(456,16)(403,16){13}
  12. input K; //: /sn:0 {0}(-235,77)(-68,77){1}
  13. input Clock; //: /sn:0 {0}(-207,186)(-179,186)(-179,217)(-98,217)(-98,193){1}
  14. //: {2}(-96,191)(10,191){3}
  15. //: {4}(-98,189)(-98,121){5}
  16. //: {6}(-96,119)(-78,119)(-78,82)(-68,82){7}
  17. //: {8}(-98,117)(-98,8)(-81,8){9}
  18. //: {10}(-100,191)(-110,191)(-110,196)(10,196){11}
  19. input J; //: /sn:0 {0}(-81,3)(-233,3){1}
  20. input Reset; //: /sn:0 {0}(-159,262)(-128,262)(-128,288)(-15,288)(-15,94){1}
  21. //: {2}(-13,92)(212,92)(212,113)(346,113)(346,94)(378,94){3}
  22. //: {4}(-15,90)(-15,79)(32,79){5}
  23. wire w6; //: {0}(31,194)(247,194)(247,97){1}
  24. //: {2}(249,95)(266,95)(266,93)(285,93){3}
  25. //: {4}(247,93)(247,23){5}
  26. //: {6}(249,21)(259,21)(259,2)(247,2)(247,-13)(257,-13){7}
  27. //: {8}(247,19)(247,12){9}
  28. wire w30; //: /sn:0 {0}(53,74)(116,74){1}
  29. //: {2}(120,74)(275,74)(275,88)(285,88){3}
  30. //: {4}(118,72)(118,23)(-5,23)(-5,8)(29,8){5}
  31. wire w12; //: /sn:0 {0}(29,3)(-48,3)(-48,3)(-60,3){1}
  32. wire w10; //: /sn:0 {0}(306,91)(342,91)(342,89)(378,89){1}
  33. wire w1; //: /sn:0 {0}(-81,-2)(-100,-2)(-100,-30)(539,-30)(539,87){1}
  34. //: {2}(541,89)(559,89)(559,77){3}
  35. //: {4}(537,89)(462,89){5}
  36. //: {6}(460,87)(460,35)(344,35)(344,18)(382,18){7}
  37. //: {8}(458,89)(399,89){9}
  38. wire w8; //: /sn:0 {0}(382,13)(332,13)(332,-15)(278,-15){1}
  39. wire w2; //: /sn:0 {0}(32,74)(-28,74)(-28,77)(-47,77){1}
  40. wire w15; //: /sn:0 {0}(32,69)(-3,69)(-3,49)(90,49)(90,8){1}
  41. //: {2}(92,6)(247,6)(247,-18)(257,-18){3}
  42. //: {4}(88,6)(50,6){5}
  43. //: enddecls
  44.  
  45. nand g4 (.I0(w12), .I1(w30), .Z(w15)); //: @(40,6) /sn:0 /w:[ 0 5 5 ]
  46. nand g8 (.I0(w15), .I1(w2), .I2(Reset), .Z(w30)); //: @(43,74) /sn:0 /w:[ 0 0 5 0 ]
  47. nand g3 (.I0(w30), .I1(w6), .Z(w10)); //: @(296,91) /sn:0 /w:[ 3 3 0 ]
  48. //: joint g16 (Clock) @(-98, 119) /w:[ 6 8 -1 5 ]
  49. //: comment g26 /dolink:0 /link:"" @(132,53) /sn:0
  50. //: /line:"Qm-"
  51. //: /end
  52. //: joint g17 (Clock) @(-98, 191) /w:[ 2 4 10 1 ]
  53. nand g2 (.I0(w15), .I1(w6), .Z(w8)); //: @(268,-15) /sn:0 /w:[ 3 7 1 ]
  54. //: joint g30 (Reset) @(-15, 92) /w:[ 2 4 -1 1 ]
  55. //: joint g23 (w1) @(460, 89) /w:[ 5 6 8 -1 ]
  56. //: joint g24 (Q) @(519, 16) /w:[ 8 -1 7 10 ]
  57. nand g1 (.I0(Q), .I1(K), .I2(Clock), .Z(w2)); //: @(-57,77) /sn:0 /w:[ 11 1 7 1 ]
  58. //: joint g18 (w6) @(247, 95) /w:[ 2 4 -1 1 ]
  59. //: joint g25 (w1) @(539, 89) /w:[ 2 1 4 -1 ]
  60. //: comment g10 /dolink:0 /link:"" @(-247,11) /sn:0
  61. //: /line:"J"
  62. //: /line:""
  63. //: /end
  64. nand g6 (.I0(Clock), .I1(Clock), .Z(w6)); //: @(21,194) /sn:0 /w:[ 3 11 0 ]
  65. //: input g35 (Reset) @(-161,262) /sn:0 /w:[ 0 ]
  66. //: comment g9 /dolink:0 /link:"" @(133,-13) /sn:0
  67. //: /line:"Qm"
  68. //: /line:""
  69. //: /end
  70. //: joint g7 (w15) @(90, 6) /w:[ 2 -1 4 1 ]
  71. //: input g31 (J) @(-235,3) /sn:0 /w:[ 1 ]
  72. //: joint g22 (Q) @(458, 0) /w:[ -1 1 2 4 ]
  73. //: comment g12 /dolink:0 /link:"" @(-252,211) /sn:0
  74. //: /line:"Clock"
  75. //: /line:""
  76. //: /end
  77. //: joint g34 (w6) @(247, 21) /w:[ 6 8 -1 5 ]
  78. //: comment g28 /dolink:0 /link:"" @(566,-8) /sn:0
  79. //: /line:"Q"
  80. //: /line:""
  81. //: /end
  82. //: input g14 (Clock) @(-209,186) /sn:0 /w:[ 0 ]
  83. //: joint g5 (w30) @(118, 74) /w:[ 2 4 1 -1 ]
  84. //: comment g11 /dolink:0 /link:"" @(-246,106) /sn:0
  85. //: /line:"K"
  86. //: /line:""
  87. //: /end
  88. //: joint g21 (Q) @(458, 16) /w:[ 6 5 12 -1 ]
  89. nand g19 (.I0(w8), .I1(w1), .Z(Q)); //: @(393,16) /sn:0 /w:[ 0 7 13 ]
  90. nand g20 (.I0(Q), .I1(w10), .I2(Reset), .Z(w1)); //: @(389,89) /sn:0 /w:[ 3 1 3 9 ]
  91. //: output g15 (Q) @(584,6) /sn:0 /w:[ 9 ]
  92. nand g0 (.I0(w1), .I1(J), .I2(Clock), .Z(w12)); //: @(-70,3) /sn:0 /w:[ 0 0 9 1 ]
  93. //: comment g27 /dolink:0 /link:"" @(560,104) /sn:0
  94. //: /line:"Q-"
  95. //: /line:""
  96. //: /line:""
  97. //: /end
  98. //: input g13 (K) @(-237,77) /sn:0 /w:[ 0 ]
  99.  
  100. endmodule
  101.  
  102. module JK();
  103. //: interface /sz:(40, 40) /bd:[ ]
  104. //: enddecls
  105.  
  106.  
  107. endmodule
  108.  
  109. module new_block();
  110. //: interface /sz:(176, 187) /bd:[ ]
  111. //: enddecls
  112.  
  113.  
  114. endmodule
  115.  
  116. module JK_flip_flop();
  117. //: interface /sz:(40, 40) /bd:[ ]
  118. //: enddecls
  119.  
  120.  
  121. endmodule
  122.  
  123. module main; //: root_module
  124. supply1 w13; //: /sn:0 {0}(-65,619)(-65,683)(43,683){1}
  125. //: {2}(47,683)(69,683)(69,685)(97,685){3}
  126. //: {4}(45,685)(45,839)(97,839){5}
  127. wire w6; //: {0}(186,325)(402,325)(402,228){1}
  128. //: {2}(404,226)(421,226)(421,224)(440,224){3}
  129. //: {4}(402,224)(402,154){5}
  130. //: {6}(404,152)(414,152)(414,133)(402,133)(402,118)(412,118){7}
  131. //: {8}(402,150)(402,143){9}
  132. wire w7; //: /sn:0 {0}(533,225)(501,225)(501,244)(367,244)(367,223)(142,223){1}
  133. //: {2}(140,221)(140,210)(187,210){3}
  134. //: {4}(140,225)(140,419)(3,419){5}
  135. wire w4; //: /sn:0 /dp:1 {0}(87,208)(-9,208){1}
  136. wire w0; //: /sn:0 {0}(97,757)(26,757)(26,938){1}
  137. //: {2}(28,940)(359,940)(359,751)(420,751){3}
  138. //: {4}(26,942)(26,968)(-28,968){5}
  139. wire w3; //: /sn:0 {0}(738,139)(738,147)(676,147){1}
  140. //: {2}(672,147)(615,147){3}
  141. //: {4}(613,145)(613,133){5}
  142. //: {6}(613,129)(613,127){7}
  143. //: {8}(611,131)(519,131)(519,215)(533,215){9}
  144. //: {10}(611,147)(558,147){11}
  145. //: {12}(674,149)(674,367)(19,367)(19,203)(87,203){13}
  146. wire w22; //: /sn:0 {0}(87,213)(77,213)(77,250)(59,250){1}
  147. //: {2}(57,248)(57,139)(74,139){3}
  148. //: {4}(57,252)(57,320){5}
  149. //: {6}(59,322)(165,322){7}
  150. //: {8}(55,322)(45,322)(45,327)(165,327){9}
  151. //: {10}(57,324)(57,348)(-51,348){11}
  152. wire w30; //: /sn:0 {0}(208,205)(271,205){1}
  153. //: {2}(275,205)(430,205)(430,219)(440,219){3}
  154. //: {4}(273,203)(273,154)(150,154)(150,139)(184,139){5}
  155. wire w19; //: /sn:0 {0}(301,695)(320,695)(320,693)(346,693){1}
  156. //: {2}(350,693)(360,693){3}
  157. //: {4}(364,693)(412,693)(412,688)(420,688){5}
  158. //: {6}(362,691)(362,604)(283,604)(283,498)(364,498){7}
  159. //: {8}(348,695)(348,830)(420,830){9}
  160. wire w12; //: /sn:0 /dp:1 {0}(184,134)(107,134)(107,134)(95,134){1}
  161. wire w10; //: /sn:0 {0}(461,222)(497,222)(497,220)(533,220){1}
  162. wire [1:0] w21; //: /sn:0 /dp:1 {0}(370,493)(670,493)(670,501)(677,501)(677,448)(678,448)(678,438){1}
  163. wire w1; //: /sn:0 /dp:1 {0}(74,134)(-7,134){1}
  164. wire w8; //: /sn:0 /dp:1 {0}(537,144)(487,144)(487,116)(433,116){1}
  165. wire w11; //: /sn:0 {0}(114,549)(177,549)(177,626){1}
  166. //: {2}(179,628)(501,628)(501,671){3}
  167. //: {4}(177,630)(177,650)(171,650)(171,668){5}
  168. wire w2; //: /sn:0 {0}(187,205)(127,205)(127,208)(108,208){1}
  169. wire w15; //: /sn:0 /dp:1 {0}(187,200)(152,200)(152,180)(245,180)(245,139){1}
  170. //: {2}(247,137)(402,137)(402,113)(412,113){3}
  171. //: {4}(243,137)(205,137){5}
  172. wire w5; //: /sn:0 {0}(739,210)(739,220)(696,220){1}
  173. //: {2}(694,218)(694,101)(55,101)(55,129)(74,129){3}
  174. //: {4}(692,220)(617,220){5}
  175. //: {6}(615,218)(615,166)(499,166)(499,149)(537,149){7}
  176. //: {8}(613,220)(554,220){9}
  177. wire w9; //: /sn:0 {0}(625,711)(635,711)(635,696)(669,696)(669,541)(315,541)(315,488)(364,488){1}
  178. //: enddecls
  179.  
  180. nand g4 (.I0(w12), .I1(w30), .Z(w15)); //: @(195,137) /sn:0 /w:[ 0 5 5 ]
  181. nand g8 (.I0(w15), .I1(w2), .I2(w7), .Z(w30)); //: @(198,205) /sn:0 /w:[ 0 0 3 0 ]
  182. nand g3 (.I0(w30), .I1(w6), .Z(w10)); //: @(451,222) /sn:0 /w:[ 3 3 0 ]
  183. //: joint g16 (w22) @(57, 250) /w:[ 1 2 -1 4 ]
  184. //: comment g26 /dolink:0 /link:"" @(287,184) /sn:0
  185. //: /line:"Qm-"
  186. //: /end
  187. //: joint g17 (w22) @(57, 322) /w:[ 6 5 8 10 ]
  188. nand g2 (.I0(w15), .I1(w6), .Z(w8)); //: @(423,116) /sn:0 /w:[ 3 7 1 ]
  189. //: joint g30 (w7) @(140, 223) /w:[ 1 2 -1 4 ]
  190. //: joint g23 (w5) @(615, 220) /w:[ 5 6 8 -1 ]
  191. JK_flipflop g39 (.Reset(w11), .K(w19), .Clock(w0), .J(w19), .Q(w9)); //: @(421, 672) /sz:(203, 174) /sn:0 /p:[ Ti0>3 Li0>9 Li1>3 Li2>5 Ro0<0 ]
  192. //: joint g24 (w3) @(674, 147) /w:[ 1 -1 2 12 ]
  193. nand g1 (.I0(w3), .I1(w4), .I2(w22), .Z(w2)); //: @(98,208) /sn:0 /w:[ 13 0 0 1 ]
  194. //: switch g29 (w7) @(-14,419) /sn:0 /w:[ 5 ] /st:1
  195. //: joint g18 (w6) @(402, 226) /w:[ 2 4 -1 1 ]
  196. //: joint g25 (w5) @(694, 220) /w:[ 1 2 4 -1 ]
  197. //: comment g10 /dolink:0 /link:"" @(-92,142) /sn:0
  198. //: /line:"J"
  199. //: /line:""
  200. //: /end
  201. nand g6 (.I0(w22), .I1(w22), .Z(w6)); //: @(176,325) /sn:0 /w:[ 7 9 0 ]
  202. //: switch g35 (w0) @(-45,968) /sn:0 /w:[ 5 ] /st:0
  203. //: comment g9 /dolink:0 /link:"" @(288,118) /sn:0
  204. //: /line:"Qm"
  205. //: /line:""
  206. //: /end
  207. //: joint g7 (w15) @(245, 137) /w:[ 2 -1 4 1 ]
  208. //: comment g31 /dolink:0 /link:"" @(86,566) /sn:0
  209. //: /line:"Reset"
  210. //: /end
  211. //: joint g22 (w3) @(613, 131) /w:[ -1 6 8 5 ]
  212. concat g45 (.I0(w19), .I1(w9), .Z(w21)); //: @(369,493) /sn:0 /w:[ 7 1 0 ] /dr:0
  213. //: joint g41 (w13) @(45, 683) /w:[ 2 -1 1 4 ]
  214. //: supply1 g36 (w13) @(-54,619) /sn:0 /w:[ 0 ]
  215. led g33 (.I(w5)); //: @(739,203) /sn:0 /w:[ 0 ] /type:0
  216. //: joint g42 (w0) @(26, 940) /w:[ 2 1 -1 4 ]
  217. //: joint g40 (w11) @(177, 628) /w:[ 2 1 -1 4 ]
  218. //: comment g12 /dolink:0 /link:"" @(-89,367) /sn:0
  219. //: /line:"Clock"
  220. //: /line:""
  221. //: /end
  222. //: joint g46 (w19) @(362, 693) /w:[ 4 6 3 -1 ]
  223. //: joint g34 (w6) @(402, 152) /w:[ 6 8 -1 5 ]
  224. //: comment g28 /dolink:0 /link:"" @(721,123) /sn:0
  225. //: /line:"Q"
  226. //: /line:""
  227. //: /end
  228. //: joint g5 (w30) @(273, 205) /w:[ 2 4 1 -1 ]
  229. //: switch g14 (w4) @(-26,208) /sn:0 /w:[ 1 ] /st:1
  230. //: comment g11 /dolink:0 /link:"" @(-91,237) /sn:0
  231. //: /line:"K"
  232. //: /line:""
  233. //: /end
  234. //: joint g21 (w3) @(613, 147) /w:[ 3 4 10 -1 ]
  235. nand g19 (.I0(w8), .I1(w5), .Z(w3)); //: @(548,147) /sn:0 /w:[ 0 7 11 ]
  236. led g32 (.I(w3)); //: @(738,132) /sn:0 /w:[ 0 ] /type:0
  237. nand g20 (.I0(w3), .I1(w10), .I2(w7), .Z(w5)); //: @(544,220) /sn:0 /w:[ 9 1 0 9 ]
  238. //: joint g43 (w19) @(348, 693) /w:[ 2 -1 1 8 ]
  239. JK_flipflop g38 (.Reset(w11), .K(w13), .Clock(w0), .J(w13), .Q(w19)); //: @(98, 669) /sz:(202, 184) /sn:0 /p:[ Ti0>5 Li0>5 Li1>0 Li2>3 Ro0<0 ]
  240. //: switch g15 (w22) @(-68,348) /sn:0 /w:[ 11 ] /st:0
  241. nand g0 (.I0(w5), .I1(w1), .I2(w22), .Z(w12)); //: @(85,134) /sn:0 /w:[ 3 0 3 1 ]
  242. led g48 (.I(w21)); //: @(678,431) /sn:0 /w:[ 1 ] /type:3
  243. //: comment g27 /dolink:0 /link:"" @(715,235) /sn:0
  244. //: /line:"Q-"
  245. //: /line:""
  246. //: /line:""
  247. //: /end
  248. //: switch g37 (w11) @(97,549) /sn:0 /w:[ 0 ] /st:1
  249. //: switch g13 (w1) @(-24,134) /sn:0 /w:[ 1 ] /st:1
  250.  
  251. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement