Repository navigation
Expand file tree
/
Copy pathadjustable-counter.rgate
More file actions
1 lines (1 loc) · 5.62 KB
/
Copy pathadjustable-counter.rgate
File metadata and controls
1 lines (1 loc) · 5.62 KB
1
{"format":"rgate","version":1,"circuit":{"title":"Adjustable 8-bit counter","root":"main","modules":[{"name":"main","gates":[{"id":1,"name":"CLK","kind":"clock","position":{"x":140.0,"y":100.0},"rotation":0,"width":1,"input_count":2,"delay":1,"period":100,"initial":{"bits":["Low"]},"pins":[{"name":"Z","direction":"output","width":1,"offset":{"x":13.0,"y":0.0},"net":1}],"text":"","show_name":true,"config":{}},{"id":2,"name":"RESET_N","kind":"switch","position":{"x":360.0,"y":100.0},"rotation":0,"width":1,"input_count":2,"delay":1,"period":500,"initial":{"bits":["Low"]},"pins":[{"name":"Z","direction":"output","width":1,"offset":{"x":17.0,"y":0.0},"net":2}],"text":"","show_name":true,"config":{}},{"id":3,"name":"constant_zero","kind":"dip","position":{"x":580.0,"y":100.0},"rotation":0,"width":1,"input_count":2,"delay":1,"period":500,"initial":{"bits":["Low"]},"pins":[{"name":"Z","direction":"output","width":1,"offset":{"x":0.0,"y":10.0},"net":3}],"text":"","show_name":true,"config":{}},{"id":4,"name":"ENABLE_N","kind":"switch","position":{"x":800.0,"y":100.0},"rotation":0,"width":1,"input_count":2,"delay":1,"period":500,"initial":{"bits":["Low"]},"pins":[{"name":"Z","direction":"output","width":1,"offset":{"x":17.0,"y":0.0},"net":4}],"text":"","show_name":true,"config":{}},{"id":5,"name":"STEP","kind":"dip","position":{"x":1020.0,"y":100.0},"rotation":0,"width":8,"input_count":2,"delay":1,"period":500,"initial":{"bits":["High","Low","Low","Low","Low","Low","Low","Low"]},"pins":[{"name":"Z","direction":"output","width":8,"offset":{"x":0.0,"y":10.0},"net":5}],"text":"","show_name":true,"config":{}},{"id":6,"name":"next_count","kind":"add","position":{"x":140.0,"y":265.0},"rotation":0,"width":8,"input_count":2,"delay":1,"period":500,"initial":{"bits":["Low","Low","Low","Low","Low","Low","Low","Low"]},"pins":[{"name":"A","direction":"input","width":8,"offset":{"x":-16.0,"y":-16.0},"net":6},{"name":"B","direction":"input","width":8,"offset":{"x":16.0,"y":-16.0},"net":5},{"name":"CI","direction":"input","width":1,"offset":{"x":24.0,"y":-2.0},"net":3},{"name":"S","direction":"output","width":8,"offset":{"x":0.0,"y":13.0},"net":7},{"name":"CO","direction":"output","width":1,"offset":{"x":-24.0,"y":-2.0},"net":8}],"text":"","show_name":true,"config":{}},{"id":7,"name":"count","kind":"register","position":{"x":360.0,"y":265.0},"rotation":0,"width":8,"input_count":2,"delay":1,"period":500,"initial":{"bits":["Low","Low","Low","Low","Low","Low","Low","Low"]},"pins":[{"name":"D","direction":"input","width":8,"offset":{"x":0.0,"y":-10.0},"net":7},{"name":"EN","direction":"input","width":1,"offset":{"x":39.0,"y":5.0},"net":4},{"name":"CLR","direction":"input","width":1,"offset":{"x":39.0,"y":-5.0},"net":2},{"name":"CK","direction":"input","width":1,"offset":{"x":-37.0,"y":0.0},"net":1},{"name":"Q","direction":"output","width":8,"offset":{"x":0.0,"y":11.0},"net":6}],"text":"","show_name":true,"config":{}},{"id":8,"name":"COUNT","kind":"led","position":{"x":580.0,"y":265.0},"rotation":0,"width":8,"input_count":2,"delay":1,"period":500,"initial":{"bits":["Low","Low","Low","Low","Low","Low","Low","Low"]},"pins":[{"name":"I","direction":"input","width":8,"offset":{"x":0.0,"y":7.0},"net":6}],"text":"","show_name":true,"config":{"led_display":"hex"}},{"id":9,"name":"instructions","kind":"comment","position":{"x":80.0,"y":520.0},"rotation":0,"width":1,"input_count":2,"delay":1,"period":500,"initial":{"bits":["Low"]},"pins":[],"text":"8-bit adjustable counter. Start in reset, then RESET_N -> 1.\nENABLE_N=0 counts; 1 holds. STEP selects increment (hex).\nCOUNT wraps modulo 256; probe CLK/count/next_count.","show_name":true,"config":{}}],"nets":[{"id":1,"name":"CLK","width":1,"show_name":true,"port":null},{"id":2,"name":"RESET_N","width":1,"show_name":true,"port":null},{"id":3,"name":"zero","width":1,"show_name":true,"port":null},{"id":4,"name":"ENABLE_N","width":1,"show_name":true,"port":null},{"id":5,"name":"step","width":8,"show_name":true,"port":null},{"id":6,"name":"count","width":8,"show_name":true,"port":null},{"id":7,"name":"next_count","width":8,"show_name":true,"port":null},{"id":8,"name":"next_count_carry","width":1,"show_name":true,"port":null}],"wires":[{"id":1,"net":1,"points":[{"x":153.0,"y":100.0},{"x":310.0,"y":100.0},{"x":310.0,"y":265.0},{"x":323.0,"y":265.0}],"start":{"gate":1,"pin":"Z"},"end":{"gate":7,"pin":"CK"}},{"id":2,"net":2,"points":[{"x":377.0,"y":100.0},{"x":410.0,"y":100.0},{"x":410.0,"y":260.0},{"x":399.0,"y":260.0}],"start":{"gate":2,"pin":"Z"},"end":{"gate":7,"pin":"CLR"}},{"id":3,"net":3,"points":[{"x":580.0,"y":110.0},{"x":580.0,"y":123.0},{"x":182.0,"y":123.0},{"x":182.0,"y":263.0},{"x":164.0,"y":263.0}],"start":{"gate":3,"pin":"Z"},"end":{"gate":6,"pin":"CI"}},{"id":4,"net":4,"points":[{"x":817.0,"y":100.0},{"x":829.0,"y":100.0},{"x":829.0,"y":224.0},{"x":530.0,"y":224.0},{"x":530.0,"y":270.0},{"x":399.0,"y":270.0}],"start":{"gate":4,"pin":"Z"},"end":{"gate":7,"pin":"EN"}},{"id":5,"net":5,"points":[{"x":1020.0,"y":110.0},{"x":1020.0,"y":125.0},{"x":156.0,"y":125.0},{"x":156.0,"y":249.0}],"start":{"gate":5,"pin":"Z"},"end":{"gate":6,"pin":"B"}},{"id":6,"net":6,"points":[{"x":360.0,"y":276.0},{"x":360.0,"y":288.0},{"x":182.0,"y":288.0},{"x":182.0,"y":238.0},{"x":124.0,"y":238.0},{"x":124.0,"y":249.0}],"start":{"gate":7,"pin":"Q"},"end":{"gate":6,"pin":"A"}},{"id":7,"net":6,"points":[{"x":360.0,"y":276.0},{"x":360.0,"y":284.0},{"x":580.0,"y":284.0},{"x":580.0,"y":272.0}],"start":{"gate":7,"pin":"Q"},"end":{"gate":8,"pin":"I"}},{"id":8,"net":7,"points":[{"x":140.0,"y":278.0},{"x":140.0,"y":292.0},{"x":310.0,"y":292.0},{"x":310.0,"y":242.0},{"x":360.0,"y":242.0},{"x":360.0,"y":255.0}],"start":{"gate":6,"pin":"S"},"end":{"gate":7,"pin":"D"}}]}]}}