re simulator primitives

Boolean primitives
---------------------------------------------
Name  Domain   Range   Effect
---------------------------------------------
not   .1       .2      .2 = NOT .1
and   <.1, .2> .3      .3 = .1 AND .2
or    <.1, .2> .3      .3 = .1 OR .2
nand  <.1, .2> .3      .3 = .1 NAND .2
nor   <.1, .2> .3      .3 = .1 NOR .2
xor   <.1, .2> .3      .3 = .1 XOR .2
xnor  <.1, .2> .3      .3 = .1 XNOR .2
---------------------------------------------
(note that Boolean data must either be "T" or "F")

Numerical primitives
---------------------------------------------
Name   Domain    Range   Effect
---------------------------------------------
add    <.1, .2>  .3      .3 = .1 + .2
minus  <.1, .2>  .3      .3 = .1 - .2
mult   <.1, .2>  .3      .3 = .1 * .2
div    <.1, .2>  .3      .3 = .1 / .2  (quotient)
mod    <.1, .2>  .3      .3 = .1 mod .2
inc    .1        .2      .2 = .1 + 1
dec    .1        .2      .2 = .1 - 1
eq     <.1, .2>  .3      .3 = (if .1 = .2 then T else F)
ltn    <.1, .2>  .3      .3 = (if .1 < .2 then T else F)
gtn    <.1, .2>  .3      .3 = (if .1 > .2 then T else F)
leq    <.1, .2>  .3      .3 = (if .1 <= .2 then T else F)
geq    <.1, .2>  .3      .3 = (if .1 >= .2 then T else F)
max    <.1, .2>  .3      .3 = (if .1 > .2 then .1 else .2)
min    <.1, .2>  .3      .3 = (if .1 < .2 then .1 else .2)
abs    .1        .2      .2 = |.1|
---------------------------------------------
(most should work on both integers and reals)

Multiplexer (with parameter n being length of the second list)
---------------------------------------------------------
Name  Parameter(=2)  Domain        Range   Effect
---------------------------------------------------------
MUXR  2              <.1,<.2,3>>   .4     (     if .1 = 0 then .2
                                           else if .1 = 1 then .3)
---------------------------------------------------------

Bit vector to unsigned and signed integer
---------------------------------------------------------
Name      Domain          Range   Effect
---------------------------------------------------------
bit2uint  <.1,.2,.3,.4>   .5      bit vector to unsigned integer
bit2sint  <.1,.2,.3,.4>   .5      bit vector to signed integer
---------------------------------------------------------
(LSB is the leftmost bit)

Unsigned and signed integer to bit vector
---------------------------------------------------------
Name     Parameter(=4)  Domain  Range         Effect
---------------------------------------------------------
uint2bit 4              .1      <.2,.3,.4,.5> unsigned integer to bit vector
sint2bit 4              .1      <.2,.3,.4,.5> signed integer to bit vector
---------------------------------------------------------
(note parameter is needed to specify size of bit vector;
 will sign extend appropriately)

Bit vector to unsigned and signed real
---------------------------------------------------------
Name      Domain          Range   Effect
---------------------------------------------------------
bit2ureal <<.1>,<.2,.3>>  .4       to unsigned real
bit2sreal <<.1>,<.2,.3>>  .4       to signed real
---------------------------------------------------------
(f is fractional part, of size 1 above, i is the integer part)

Unsigned and signed real to bit vector
---------------------------------------------------------
Name      Parameters(=1,2)  Domain  Range          Effect
---------------------------------------------------------
ureal2bit 1 2               .1      <<.2>,<.3,.4>> unsigned real to 
sreal2bit 1 2               .1      <<.2>,<.3,.4>> signed real to 
---------------------------------------------------------
(MSB of f is the leftmost bit, LSB of i is the leftmost bit)

Integer-real conversion
---------------------------------------------------------
Name      Domain   Range   Effect
---------------------------------------------------------
real2int  .1       .2      real number to integer
int2real  .1       .2      integer to real number
---------------------------------------------------------

Integer-bit conversion
---------------------------------------------------------
Name      Domain   Range   Effect
---------------------------------------------------------
bit2int   .1       .2      Boolean to integer
int2bit   .1       .2      integer to Boolean
---------------------------------------------------------

Implementable sequential components
---------------------------------------------------------
Name   Domain   Range   Effect
---------------------------------------------------------
D      .1       .2      delay: .2(t) = .1(t-1)
DI n   .1       .2      as above, but initialised with n
---------------------------------------------------------

Non-implementable: anti-latch
---------------------------------------------------------
Name   Domain   Range   Effect
---------------------------------------------------------
AD     .1       .2      antidelay: .2(t-1) = .1(t)
---------------------------------------------------------

Please note that in the current version of Rebecca, "ev", "slow", "sdpr" and "pdsr" etc are not supported.