// carryla.e Use P and G to generate carry in for four stages define carryla(p[4], g[4], cin, c[3], cout) circuits c[0] <= g[0]|(p[0]&cin) after 1ns; c[1] <= g[1]|(p[1]&g[0])|(p[1]&p[0]&cin) after 1ns; c[2] <= g[2]|(p[2]&g[1])|(p[2]&p[1]&g[0])|(p[2]&p[1]&p[0]&cin) after 1ns; cout <= g[3]|(p[3]&g[2])|(p[3]&p[2]&g[1])|(p[3]&p[2]&p[1]&g[0])| (p[3]&p[2]&p[1]&p[0]&cin) after 1ns; end circuits; end carryla;