summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/examples/74125.cpp
blob: 807d8bf27c830d4fe5d08300732ed7971a1e558c (plain) (blame)
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
33
34
35
36
37
38
39
40
// license:CC0
// copyright-holders:Couriersud

/*
 * 74125.cpp
 *
 */

//! [74125_example]
#include "netlist/devices/net_lib.h"

// ./nltool -c run -l RL.1 src/lib/netlist/examples/74125.cpp
//  RL.1 : Output

NETLIST_START(main)

	SOLVER(Solver, 48000) // could be 1 in this example

	ANALOG_INPUT(VCC, 5.0)

	TTL_74125(X1)
	TTL_74126(X2)

	CLOCK(C1, 100)
	CLOCK(C2, 300)
	CLOCK(C3,  5)

	RES(RL, 1000)

	NET_C(C1.Q, X1.A)
	NET_C(C2.Q, X2.A)
	NET_C(C3.Q, X1.G, X2.G)

	NET_C(X1.Y, X2.Y, RL.1)

	NET_C(GND, RL.2, C1.GND, C2.GND, C3.GND, X1.GND, X2.GND)
	NET_C(VCC,       C1.VCC, C2.VCC, C3.VCC, X1.VCC, X2.VCC)

NETLIST_END()
//! [74125_example]