cpu-simulator/build/editor/js/items/CPU_ALU.js

11 lines
7.5 KiB
JavaScript
Executable File

function loadChip(){
setTimeout(function(){
chip = new Component("main", true, '{"type":"main","groups":[[0,1,2,3,4,5,6,7],[8,9,10,11,12,13,14,15],[16,17,18,19],[20],[21,22,23,24,25,26,27,28],[29,30,31,32]],"inputs":21,"tooltips":["operand 0","operand 0","operand 0","operand 0","operand 0","operand 0","operand 0","operand 0","operand 1","operand 1","operand 1","operand 1","operand 1","operand 1","operand 1","operand 1","opcode","opcode","opcode","opcode","carry/borrow in","result","result","result","result","result","result","result","result","overflow flag","negative flag","carry/borrow flag","zero flag"],"pins":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"subComponents":["ALU"],"positions":[{"x":467,"y":673}],"wires":[{"source":{"component":1,"pin":32},"destination":{"component":0,"pin":32},"wireId":0},{"source":{"component":1,"pin":31},"destination":{"component":0,"pin":31},"wireId":1},{"source":{"component":1,"pin":30},"destination":{"component":0,"pin":30},"wireId":2},{"source":{"component":1,"pin":29},"destination":{"component":0,"pin":29},"wireId":3},{"source":{"component":1,"pin":28},"destination":{"component":0,"pin":28},"wireId":4},{"source":{"component":1,"pin":27},"destination":{"component":0,"pin":27},"wireId":5},{"source":{"component":1,"pin":26},"destination":{"component":0,"pin":26},"wireId":6},{"source":{"component":1,"pin":25},"destination":{"component":0,"pin":25},"wireId":7},{"source":{"component":1,"pin":24},"destination":{"component":0,"pin":24},"wireId":8},{"source":{"component":1,"pin":23},"destination":{"component":0,"pin":23},"wireId":9},{"source":{"component":1,"pin":22},"destination":{"component":0,"pin":22},"wireId":10},{"source":{"component":1,"pin":21},"destination":{"component":0,"pin":21},"wireId":11},{"source":{"component":0,"pin":0},"destination":{"component":1,"pin":0},"wireId":12},{"source":{"component":0,"pin":1},"destination":{"component":1,"pin":1},"wireId":13},{"source":{"component":0,"pin":2},"destination":{"component":1,"pin":2},"wireId":15},{"source":{"component":0,"pin":3},"destination":{"component":1,"pin":3},"wireId":16},{"source":{"component":0,"pin":4},"destination":{"component":1,"pin":4},"wireId":17},{"source":{"component":0,"pin":5},"destination":{"component":1,"pin":5},"wireId":18},{"source":{"component":0,"pin":6},"destination":{"component":1,"pin":6},"wireId":19},{"source":{"component":0,"pin":7},"destination":{"component":1,"pin":7},"wireId":20},{"source":{"component":0,"pin":8},"destination":{"component":1,"pin":8},"wireId":21},{"source":{"component":0,"pin":9},"destination":{"component":1,"pin":9},"wireId":22},{"source":{"component":0,"pin":10},"destination":{"component":1,"pin":10},"wireId":23},{"source":{"component":0,"pin":11},"destination":{"component":1,"pin":11},"wireId":24},{"source":{"component":0,"pin":12},"destination":{"component":1,"pin":12},"wireId":25},{"source":{"component":0,"pin":13},"destination":{"component":1,"pin":13},"wireId":26},{"source":{"component":0,"pin":14},"destination":{"component":1,"pin":14},"wireId":27},{"source":{"component":0,"pin":15},"destination":{"component":1,"pin":15},"wireId":28},{"source":{"component":0,"pin":16},"destination":{"component":1,"pin":16},"wireId":29},{"source":{"component":0,"pin":17},"destination":{"component":1,"pin":17},"wireId":30},{"source":{"component":0,"pin":18},"destination":{"component":1,"pin":18},"wireId":31},{"source":{"component":0,"pin":19},"destination":{"component":1,"pin":19},"wireId":32},{"source":{"component":0,"pin":20},"destination":{"component":1,"pin":20},"wireId":33}]}');
chip.groups = []
chip.tooltips = ["A","B","nand/xor?","output"];
},1000)
setTimeout(function(){
wireVisuals = JSON.parse('[{"wireId":0,"path":[{"component":1,"pin":32,"shift":false,"rev":1},{"component":0,"pin":32,"shift":false,"offset":77}]},{"wireId":1,"path":[{"component":1,"pin":31,"shift":false,"rev":1},{"component":0,"pin":31,"shift":false,"offset":70}]},{"wireId":2,"path":[{"component":1,"pin":30,"shift":false,"rev":1},{"component":0,"pin":30,"shift":false,"offset":63}]},{"wireId":3,"path":[{"component":1,"pin":29,"shift":false,"rev":1},{"component":0,"pin":29,"shift":false,"offset":56}]},{"wireId":4,"path":[{"component":1,"pin":28,"shift":false,"rev":1},{"component":0,"pin":28,"shift":false,"offset":49}]},{"wireId":5,"path":[{"component":1,"pin":27,"shift":false,"rev":1},{"component":0,"pin":27,"shift":false,"offset":42}]},{"wireId":6,"path":[{"component":1,"pin":26,"shift":false,"rev":1},{"component":0,"pin":26,"shift":false,"offset":35}]},{"wireId":7,"path":[{"component":1,"pin":25,"shift":false,"rev":1},{"component":0,"pin":25,"shift":false,"offset":28}]},{"wireId":8,"path":[{"component":1,"pin":24,"shift":false,"rev":1},{"component":0,"pin":24,"shift":false,"offset":21}]},{"wireId":9,"path":[{"component":1,"pin":23,"shift":false,"rev":1},{"component":0,"pin":23,"shift":false,"offset":14}]},{"wireId":10,"path":[{"component":1,"pin":22,"shift":false,"rev":1},{"component":0,"pin":22,"shift":false,"offset":7}]},{"wireId":11,"path":[{"component":1,"pin":21,"shift":false,"rev":1},{"component":0,"pin":21,"shift":false,"offset":0}]},{"wireId":12,"path":[{"component":0,"pin":0,"shift":false,"rev":1},{"component":1,"pin":0,"shift":false,"offset":0}]},{"wireId":13,"path":[{"component":0,"pin":1,"shift":false,"rev":1},{"component":1,"pin":1,"shift":false,"offset":7}]},{"wireId":15,"path":[{"component":0,"pin":2,"shift":false,"rev":1},{"component":1,"pin":2,"shift":false,"offset":14}]},{"wireId":16,"path":[{"component":0,"pin":3,"shift":false,"rev":1},{"component":1,"pin":3,"shift":false,"offset":21}]},{"wireId":17,"path":[{"component":0,"pin":4,"shift":false,"rev":1},{"component":1,"pin":4,"shift":false,"offset":28}]},{"wireId":18,"path":[{"component":0,"pin":5,"shift":false,"rev":1},{"component":1,"pin":5,"shift":false,"offset":35}]},{"wireId":19,"path":[{"component":0,"pin":6,"shift":false,"rev":1},{"component":1,"pin":6,"shift":false,"offset":42}]},{"wireId":20,"path":[{"component":0,"pin":7,"shift":false,"rev":1},{"component":1,"pin":7,"shift":false,"offset":49}]},{"wireId":21,"path":[{"component":0,"pin":8,"shift":false,"rev":1},{"component":1,"pin":8,"shift":false,"offset":56}]},{"wireId":22,"path":[{"component":0,"pin":9,"shift":false,"rev":1},{"component":1,"pin":9,"shift":false,"offset":63}]},{"wireId":23,"path":[{"component":0,"pin":10,"shift":false,"rev":1},{"component":1,"pin":10,"shift":false,"offset":70}]},{"wireId":24,"path":[{"component":0,"pin":11,"shift":false,"rev":1},{"component":1,"pin":11,"shift":false,"offset":77}]},{"wireId":25,"path":[{"component":0,"pin":12,"shift":false,"rev":1},{"component":1,"pin":12,"shift":false,"offset":84}]},{"wireId":26,"path":[{"component":0,"pin":13,"shift":false,"rev":1},{"component":1,"pin":13,"shift":false,"offset":91}]},{"wireId":27,"path":[{"component":0,"pin":14,"shift":false,"rev":1},{"component":1,"pin":14,"shift":false,"offset":98}]},{"wireId":28,"path":[{"component":0,"pin":15,"shift":false,"rev":1},{"component":1,"pin":15,"shift":false,"offset":105}]},{"wireId":29,"path":[{"component":0,"pin":16,"shift":false,"rev":1},{"component":1,"pin":16,"shift":false,"offset":112}]},{"wireId":30,"path":[{"component":0,"pin":17,"shift":false,"rev":1},{"component":1,"pin":17,"shift":false,"offset":119}]},{"wireId":31,"path":[{"component":0,"pin":18,"shift":false,"rev":1},{"component":1,"pin":18,"shift":false,"offset":126}]},{"wireId":32,"path":[{"component":0,"pin":19,"shift":false,"rev":1},{"component":1,"pin":19,"shift":false,"offset":133}]},{"wireId":33,"path":[{"component":0,"pin":20,"shift":false,"rev":1},{"component":1,"pin":20,"shift":false,"offset":140}]}]');
},2000);
}