from pyarch.utils import ioManager from pyarch.connectors import transport from pyarch.sequential import ff inputS = transport.wires(1) inputR = transport.wires(1) out = transport.wires(2) clock = transport.wires(1) hware = ff.SRFlipFlop(inputS, inputR, out, clock) iohandler = ioManager.StringIO(hware) print(iohandler.input('0', '1', '1')) # S-bit R-bit Clock
from pyarch.utils import ioManager from pyarch.connectors import transport from pyarch.combinational import arithmetics inputA = transport.wires(3) out = transport.wires(2) hware = arithmetics.FullAdder(inputA, out) iohandler = ioManager.StringIO(hware) print iohandler.input('011') # 'carry bit + 2 sum bits'
from pyarch.utils import ioManager from pyarch.connectors import transport from pyarch.combinational import arithmetics inputA = transport.wires(4) inputB = transport.wires(4) out = transport.wires(5) hware = arithmetics.PipoAdder(inputA, inputB, out) iohandler = ioManager.StringIO(hware) print(iohandler.input('1111', '1111'))
from pyarch.utils import ioManager from pyarch.connectors import transport from pyarch.combinational import gates inputA = transport.wires(1) inputB = transport.wires(1) inputC = transport.wires(1) hWare = gates.AndGate(inputA, inputB, inputC) ioHandler = ioManager.StringIO(hWare) print((ioHandler.input('1', '1')))
from pyarch.utils import ioManager from pyarch.connectors import transport from pyarch.combinational import decoders inputA = transport.wires(1) inputB = transport.wires(1) output = transport.wires(4) iohandler = ioManager.StringIO(decoders.Decoder2x4(inputA, inputB, output)) print iohandler.input('0', '1')