Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
intro_example:loops [2020/12/02 01:00]
127.0.0.1 external edit
intro_example:loops [2022/05/13 09:20]
rajit
Line 3: Line 3:
 Complex datapath designs are often designed with array of simpler cells. The following example show how to create array of simple cells and connect them using loop constructs in ACT. Complex datapath designs are often designed with array of simpler cells. The following example show how to create array of simple cells and connect them using loop constructs in ACT.
  
-<code>+<code act>
 import "adder.act"; import "adder.act";
  
Line 21: Line 21:
 Here are different ways of writing the same loop using another variant of signal connection. Here are different ways of writing the same loop using another variant of signal connection.
  
-<code>+<code act>
 (i : 8 : fa[i].a=a[i]; fa[i].b=b[i]; fa[i].ci=c[i]; fa[i].s=s[i]; fa[i].co=fa[i+1].ci; ) (i : 8 : fa[i].a=a[i]; fa[i].b=b[i]; fa[i].ci=c[i]; fa[i].s=s[i]; fa[i].co=fa[i+1].ci; )
 </code> </code>
Line 27: Line 27:
 This version makes all the connections to the ports explicitly using the connection syntax. Since it is common to connect a number of ports to the same circuit in close proximity in the ACT file, the following syntax is also supported. This version makes all the connections to the ports explicitly using the connection syntax. Since it is common to connect a number of ports to the same circuit in close proximity in the ACT file, the following syntax is also supported.
  
-<code>+<code act>
 (i : 8 : fa[i](.a=a[i], .b=b[i], .ci=c[i], .s=s[i], .co=fa[i+1].ci) ) (i : 8 : fa[i](.a=a[i], .b=b[i], .ci=c[i], .s=s[i], .co=fa[i+1].ci) )
 </code> </code>
  
 An instance of this adder is then created in a separate file as: An instance of this adder is then created in a separate file as:
-<code>+<code act>
 import “adder8b.act”; import “adder8b.act”;
  
Line 72: Line 72:
 The example below shows how selection statement is used for conditional execution. The example below shows how selection statement is used for conditional execution.
  
-<code>+<code act>
 import "gates.act"; import "gates.act";