/***************************************************************
**  macro.h        commonly used functional modules           **
**  950801 TGR 0.1 (from SMM dlx1.c)                          **
**  950803 SMM 0.2 (adding left shifter)                      **
**  950812 SMM 0.3 (adding full adder FA)                     **
***************************************************************/

#ifndef MACRO_H
#define MACRO_H

extern "C" int max();      /* max of two integers */
extern "C" int ld();       /* log base 2, rounded to next integer */
extern "C" int power2();   /* 2^n */

extern "C" int cdecs(), ddecs();    /* decoder, slow */
extern "C" int cdecf(), ddecf();    /* decoder, fast */
extern "C" int chdec(), dhdec();    /* half decoder */
extern "C" int cenf(),  denf();     /* encoder, with flag */
extern "C" int cenc(),  denc();     /* encoder, no flag */

extern "C" int ctree(), dtree();    /* binary tree, #gates, depth */
extern "C" int czero(), dzero();    /* zero tester */
extern "C" int cEQ(),   dEQ();      /* equality tester */
extern "C" int cinc(),  dinc();     /* incrementer, ripple carry */
extern "C" int cincf(), dincf();    /* incrementer, cond. ripple */
extern "C" int ccls(),  dcls();     /* cyclic left shifter */ 

extern "C" int cFA(),   dFA();      /* full adder */
extern "C" int cRCA(),  dRCA();     /* adder (carry ripple) */
extern "C" int cPP(),   dPP();      /* parallel prefix */
extern "C" int cCLA(),  dCLA();     /* adder (carry look ahead) */
extern "C" int cCSA(),  dCSA();     /* adder (conditional sum) */
extern "C" int cA2(),   dA2();      /* A2 adder */

extern "C" int ckmux(), dkmux();    /* mux: k inputs -> 1 output */
				/* inputs: (n=width, k=number) */

extern "C" int cFL1b(), dFL1b();    /* find last 1: result in binary */
extern "C" int cFL1u(), dFL1u();    /* find last 1: clear all other bits */
extern "C" int cFF0(), dFF0();    /* find first 0: result in binary */

#endif

