Adder / Subtractor Circuit

{ "width":1200, "height":700, "showToolbox":false, "toolbox":[ {"type":"In"}, {"type":"Out"}, {"type":"Joint"}, {"type":"DC"}, {"type":"LED"}, {"type":"PushOff"}, {"type":"PushOn"}, {"type":"Toggle"}, {"type":"BUF"}, {"type":"NOT"}, {"type":"AND"}, {"type":"AND","numInputs":3}, {"type":"AND","numInputs":4}, {"type":"NAND"}, {"type":"NAND","numInputs":3}, {"type":"OR"}, {"type":"OR","numInputs":3}, {"type":"OR","numInputs":4}, {"type":"OR","numInputs":8}, {"type":"NOR"}, {"type":"EOR"}, {"type":"ENOR"}, {"type":"OSC"}, {"type":"7seg"}, {"type":"16seg"}, {"type":"4bit7seg"}, {"type":"RotaryEncoder"}, {"type":"BusIn"}, {"type":"BusOut"}, {"type":"RS-FF"}, {"type":"JK-FF"}, {"type":"T-FF"}, {"type":"D-FF"}, {"type":"8bitCounter"}, {"type":"HalfAdder"}, {"type":"FullAdder"}, {"type":"4bitAdder"}, {"type":"2to4BinaryDecoder"}, {"type":"3to8BinaryDecoder"}, {"type":"4to16BinaryDecoder"}, {"type":"DSO"}, {"type":"Delay"}, {"type":"Transmitter"}, {"type":"74181"}, {"type":"JKFFPC"}, {"type":"JKFFPCFE"} ], "devices":[ {"type":"FullAdder","id":"dev0","x":544,"y":176,"label":"FullAdder"}, {"type":"FullAdder","id":"dev1","x":544,"y":296,"label":"FullAdder"}, {"type":"FullAdder","id":"dev2","x":544,"y":424,"label":"FullAdder"}, {"type":"FullAdder","id":"dev3","x":544,"y":560,"label":"FullAdder"}, {"type":"DC","id":"dev4","x":24,"y":376,"label":"DC"}, {"type":"Joint","id":"dev5","x":376,"y":200,"label":"Joint","state":{"direction":0}}, {"type":"Joint","id":"dev6","x":376,"y":320,"label":"Joint","state":{"direction":0}}, {"type":"Joint","id":"dev7","x":376,"y":448,"label":"Joint","state":{"direction":0}}, {"type":"Joint","id":"dev8","x":376,"y":584,"label":"Joint","state":{"direction":0}}, {"type":"Joint","id":"dev9","x":360,"y":72,"label":"Joint","state":{"direction":0}}, {"type":"Joint","id":"dev10","x":376,"y":48,"label":"Joint","state":{"direction":0}}, {"type":"Toggle","id":"dev11","x":144,"y":0,"label":"Sub","state":{"on":true}}, {"type":"Joint","id":"dev12","x":592,"y":128,"label":"Joint","state":{"direction":2}}, {"type":"Joint","id":"dev13","x":544,"y":128,"label":"Joint","state":{"direction":2}}, {"type":"Joint","id":"dev14","x":592,"y":256,"label":"Joint","state":{"direction":2}}, {"type":"Joint","id":"dev15","x":544,"y":256,"label":"Joint","state":{"direction":2}}, {"type":"Joint","id":"dev16","x":592,"y":376,"label":"Joint","state":{"direction":2}}, {"type":"Joint","id":"dev17","x":544,"y":376,"label":"Joint","state":{"direction":2}}, {"type":"Joint","id":"dev18","x":592,"y":512,"label":"Joint","state":{"direction":2}}, {"type":"Joint","id":"dev19","x":544,"y":512,"label":"Joint","state":{"direction":2}}, {"type":"Joint","id":"dev20","x":640,"y":584,"label":"Joint","state":{"direction":0}}, {"type":"Joint","id":"dev21","x":656,"y":632,"label":"Joint","state":{"direction":0}}, {"type":"Toggle","id":"dev22","x":264,"y":280,"label":"A2","state":{"on":true}}, {"type":"Toggle","id":"dev23","x":264,"y":408,"label":"A3","state":{"on":true}}, {"type":"Toggle","id":"dev24","x":264,"y":544,"label":"A4","state":{"on":true}}, {"type":"Toggle","id":"dev25","x":264,"y":328,"label":"B2","state":{"on":true}}, {"type":"Toggle","id":"dev26","x":264,"y":456,"label":"B3","state":{"on":true}}, {"type":"Toggle","id":"dev27","x":264,"y":592,"label":"B4","state":{"on":true}}, {"type":"LED","id":"dev28","x":720,"y":48,"label":"S0"}, {"type":"Toggle","id":"dev29","x":264,"y":144,"label":"A1","state":{"on":true}}, {"type":"Toggle","id":"dev30","x":264,"y":200,"label":"B1","state":{"on":true}}, {"type":"Toggle","id":"dev31","x":264,"y":24,"label":"A0","state":{"on":false}}, {"type":"Toggle","id":"dev32","x":264,"y":80,"label":"B0","state":{"on":true}}, {"type":"Joint","id":"dev33","x":104,"y":48,"label":"Joint","state":{"direction":0}}, {"type":"Joint","id":"dev34","x":104,"y":152,"label":"Joint","state":{"direction":0}}, {"type":"Joint","id":"dev35","x":112,"y":288,"label":"Joint","state":{"direction":0}}, {"type":"Joint","id":"dev36","x":120,"y":416,"label":"Joint","state":{"direction":0}}, {"type":"Joint","id":"dev37","x":128,"y":560,"label":"Joint","state":{"direction":0}}, {"type":"EOR","id":"dev38","x":416,"y":72,"label":"EOR"}, {"type":"EOR","id":"dev39","x":424,"y":200,"label":"EOR"}, {"type":"EOR","id":"dev40","x":424,"y":320,"label":"EOR"}, {"type":"EOR","id":"dev41","x":424,"y":448,"label":"EOR"}, {"type":"EOR","id":"dev42","x":432,"y":584,"label":"EOR"}, {"type":"FullAdder","id":"dev43","x":544,"y":48,"label":"FullAdder"}, {"type":"LED","id":"dev44","x":720,"y":176,"label":"S1"}, {"type":"LED","id":"dev45","x":720,"y":296,"label":"S2"}, {"type":"LED","id":"dev46","x":720,"y":424,"label":"S3"}, {"type":"LED","id":"dev47","x":720,"y":560,"label":"S4"}, {"type":"LED","id":"dev48","x":720,"y":624,"label":"S5"} ], "connectors":[ {"from":"dev0.in0","to":"dev13.out0"}, {"from":"dev0.in1","to":"dev29.out0"}, {"from":"dev0.in2","to":"dev39.out0"}, {"from":"dev1.in0","to":"dev15.out0"}, {"from":"dev1.in1","to":"dev22.out0"}, {"from":"dev1.in2","to":"dev40.out0"}, {"from":"dev2.in0","to":"dev17.out0"}, {"from":"dev2.in1","to":"dev23.out0"}, {"from":"dev2.in2","to":"dev41.out0"}, {"from":"dev3.in0","to":"dev19.out0"}, {"from":"dev3.in1","to":"dev24.out0"}, {"from":"dev3.in2","to":"dev42.out0"}, {"from":"dev5.in0","to":"dev9.out0"}, {"from":"dev6.in0","to":"dev9.out0"}, {"from":"dev7.in0","to":"dev9.out0"}, {"from":"dev8.in0","to":"dev9.out0"}, {"from":"dev9.in0","to":"dev11.out0"}, {"from":"dev10.in0","to":"dev9.out0"}, {"from":"dev11.in0","to":"dev33.out0"}, {"from":"dev12.in0","to":"dev43.out1"}, {"from":"dev13.in0","to":"dev12.out0"}, {"from":"dev14.in0","to":"dev0.out1"}, {"from":"dev15.in0","to":"dev14.out0"}, {"from":"dev16.in0","to":"dev1.out1"}, {"from":"dev17.in0","to":"dev16.out0"}, {"from":"dev18.in0","to":"dev2.out1"}, {"from":"dev19.in0","to":"dev18.out0"}, {"from":"dev20.in0","to":"dev3.out1"}, {"from":"dev21.in0","to":"dev20.out0"}, {"from":"dev22.in0","to":"dev35.out0"}, {"from":"dev23.in0","to":"dev36.out0"}, {"from":"dev24.in0","to":"dev37.out0"}, {"from":"dev25.in0","to":"dev35.out0"}, {"from":"dev26.in0","to":"dev36.out0"}, {"from":"dev27.in0","to":"dev37.out0"}, {"from":"dev28.in0","to":"dev43.out0"}, {"from":"dev29.in0","to":"dev34.out0"}, {"from":"dev30.in0","to":"dev34.out0"}, {"from":"dev31.in0","to":"dev33.out0"}, {"from":"dev32.in0","to":"dev33.out0"}, {"from":"dev33.in0","to":"dev4.out0"}, {"from":"dev34.in0","to":"dev4.out0"}, {"from":"dev35.in0","to":"dev4.out0"}, {"from":"dev36.in0","to":"dev4.out0"}, {"from":"dev37.in0","to":"dev4.out0"}, {"from":"dev38.in0","to":"dev9.out0"}, {"from":"dev38.in1","to":"dev32.out0"}, {"from":"dev39.in0","to":"dev5.out0"}, {"from":"dev39.in1","to":"dev30.out0"}, {"from":"dev40.in0","to":"dev6.out0"}, {"from":"dev40.in1","to":"dev25.out0"}, {"from":"dev41.in0","to":"dev7.out0"}, {"from":"dev41.in1","to":"dev26.out0"}, {"from":"dev42.in0","to":"dev8.out0"}, {"from":"dev42.in1","to":"dev27.out0"}, {"from":"dev43.in0","to":"dev10.out0"}, {"from":"dev43.in1","to":"dev31.out0"}, {"from":"dev43.in2","to":"dev38.out0"}, {"from":"dev44.in0","to":"dev0.out0"}, {"from":"dev45.in0","to":"dev1.out0"}, {"from":"dev46.in0","to":"dev2.out0"}, {"from":"dev47.in0","to":"dev3.out0"}, {"from":"dev48.in0","to":"dev21.out0"} ] }