/**
	\file "int-arith.hac"
	Some handy arithmetic unit building blocks.  
	$Id: int-arith.hac,v 1.2 2007/05/04 03:39:20 fang Exp $
	NOTE: toming may change once we introduce non-atomix expr. eval.
 */

template <pint N>
define adder(chan?(int<N>) A, B; chan!(int<N>) S) {
int<N> a, b;
chp {
*[ A?(a), B?(b); S!(a+b) ]
}
}

template <pint N>
define subtractor(chan?(int<N>) A, B; chan!(int<N>) S) {
int<N> a, b;
chp {
*[ A?(a), B?(b); S!(a-b) ]
}
}

// TODO: incrementer, decrementer

