Usage of IC 4075

from __future__ import print_function
from BinPy import *
# Usage of IC 4075:

ic = IC_4075()

print(ic.__doc__)
Triple 3 input OR gate
Pin_6 = OR(Pin_3, Pin_4, Pin_5)
Pin_9 = OR(Pin_1, Pin_2, Pin_8)
Pin_10 = OR(Pin_11, Pin_12, Pin_13)
# The Pin configuration is:

inp = {1: 1, 2: 1, 3: 0, 4: 0, 5: 0, 7: 0, 8: 1, 11: 0, 12: 1, 13: 1, 14: 1}

# Pin initinalization

# Powering up the IC - using -- ic.setIC({14: 1, 7: 0}) -- \n

ic.setIC({14: 1, 7: 0})

# Setting the inputs of the ic

ic.setIC(inp)

# Draw the IC with the current configuration\n

ic.drawIC()
             ┌─────────◡─────────┐
             │                   │
C2: [1]    ──┤  1            14  ├──    [1] VCC
             │                   │
             │                   │
B2: [1]    ──┤  2      4     13  ├──    [1] C3:
             │                   │
             │                   │
C1: [0]    ──┤  3      0     12  ├──    [1] B3:
             │                   │
             │                   │
B1: [0]    ──┤  4      7     11  ├──    [0] A3:
             │                   │
             │                   │
A1: [0]    ──┤  5      5     10  ├──    [0] Q3:
             │                   │
             │                   │
Q1: [0]    ──┤  6             9  ├──    [0] Q2:
             │                   │
             │                   │
GND [0]    ──┤  7             8  ├──    [1] A2:
             │                   │
             └───────────────────┘
# Run the IC with the current configuration using -- print ic.run() --

# Note that the ic.run() returns a dict of pin configuration similar to

print (ic.run())
{9: 1, 10: 1, 6: 0}
# Seting the outputs to the current IC configuration using -- ic.setIC(ic.run()) --\n

ic.setIC(ic.run())

# Draw the final configuration

ic.drawIC()
             ┌─────────◡─────────┐
             │                   │
C2: [1]    ──┤  1            14  ├──    [1] VCC
             │                   │
             │                   │
B2: [1]    ──┤  2      4     13  ├──    [1] C3:
             │                   │
             │                   │
C1: [0]    ──┤  3      0     12  ├──    [1] B3:
             │                   │
             │                   │
B1: [0]    ──┤  4      7     11  ├──    [0] A3:
             │                   │
             │                   │
A1: [0]    ──┤  5      5     10  ├──    [1] Q3:
             │                   │
             │                   │
Q1: [0]    ──┤  6             9  ├──    [1] Q2:
             │                   │
             │                   │
GND [0]    ──┤  7             8  ├──    [1] A2:
             │                   │
             └───────────────────┘
# Seting the outputs to the current IC configuration using -- ic.setIC(ic.run()) --

ic.setIC(ic.run())

# Draw the final configuration

ic.drawIC()

# Run the IC

print (ic.run())
              ┌─────────◡─────────┐
              │                   │
 C2: [1]    ──┤  1            14  ├──    [1] VCC
              │                   │
              │                   │
 B2: [1]    ──┤  2      4     13  ├──    [1] C3:
              │                   │
              │                   │
 C1: [0]    ──┤  3      0     12  ├──    [1] B3:
              │                   │
              │                   │
 B1: [0]    ──┤  4      7     11  ├──    [0] A3:
              │                   │
              │                   │
 A1: [0]    ──┤  5      5     10  ├──    [1] Q3:
              │                   │
              │                   │
 Q1: [0]    ──┤  6             9  ├──    [1] Q2:
              │                   │
              │                   │
 GND [0]    ──┤  7             8  ├──    [1] A2:
              │                   │
              └───────────────────┘
{9: 1, 10: 1, 6: 0}
# Connector Outputs
c = Connector()

# Set the output connector to a particular pin of the ic
ic.setOutput(9, c)

print(c)
Connector; State: 1