Emulate ICs in Python

Most people who want to simulate logic ICs will use Verilog, VHDL, or System Verilog. Not [hsoft]. He wanted to use Python, and wrote a simple Python framework for doing just that. You can find the code on GitHub, and there is an ASCII video that won’t embed here at Hackaday, but which you can view at ASCIInema.

Below the break we have an example of “constructing” a circuit in Python using ICemu:

dec = SN74HC138()
sr1 = CD74AC164()
sr2 = CD74AC164()
mcu_pin = OutputPin('PB4')

sr1.pin_CP.wire_to(dec.pin_Y0)
sr2.pin_CP.wire_to(dec.pin_Y1)
sr1.pin_DS1.wire_to(mcu_pin)
sr2.pin_DS1.wire_to(mcu_pin)

print(dec.asciiart())
     _______
   A>|- U +|>Y7
   B>|-   +|>Y6
   C>|-   +|>Y5
 G2A>|-   +|>Y4
 

…read more

Continue reading Emulate ICs in Python