|
Because there is no looping construct in HDL, we could use a higher level language like Python to do the repetitive work for us. I did the following for And16 for example:
def producer(x):
print "Nand(a=a[%d],b=b[%d],out=w%d);" % (x,x,x)
print "Nand(a=w%d,b=w%d,out=out[%d]);" % (x,x,x)
print "\n"
for x in range(16): producer(x)
|