Control Output Terminals

A module may send message to other and/or upper modules. In this case, NSL uses control output terminals. Control output terminals are declared with 'func_out'. Upper module will use 'func' to describe the associated behavior.

Example-NS13

declare sub { input a[4],b[4]; output f[4]; func_in do(a,b); func_out done(f); } module sub { func do { done(a&b); } } declare NS13 { input a[4],b[4]; output f[4]; func_in do(a,b); } module NS13 { sub sub1; func do { sub1.do(a,b); } func sub1.done { f=sub1.f; } }

We will make a simulation on this circuitry as following command:

# ./exe NS13



The result will be available on your console.



a:0001, b:0100, f:0000 a:0011, b:1001, f:0001 a:1101, b:1101, f:1101 a:0010, b:0101, f:0000



PREV UP NEXT