# Sample code for Abra
[TOC]
## Types
Standard types used in examples
{%gist wusyong/6ca2562fd9a7ff71615b5b27a75ab0b5%}
## Boolean logic
Boolean logic LUTs
{%gist wusyong/ff3aacbe3328208d6378e9ac5a8b1545%}
## Equeal
Implementation of equal() functions for different data type sizes plus a proposal for a template functionality that will ease defining those considerably.
{%gist wusyong/4f1f771a661465dffd776d2ba215820c%}
## Negative
Implementation of neg() functions for all types, expressed in template form
{%gist wusyong/381b685ed7166d7a1c44ec86a21f2444%}
## NullOr
{%gist wusyong/ab332df5fd6159474f75d66921ac9b63%}
## Half Adder
{%gist wusyong/98254ff91e4897af5a62b06e189d34be%}
## Full Adder
{%gist wusyong/30148ea126e8db644304bcf7668258d7%}
## Increment
Increment function that uses half-adder
{%gist wusyong/cf30d60d91369182b0265bcfe7671877%}
## Decrement
Decrement function that uses half-adder
{%gist wusyong/c8c659c35d482ee103aef2fa2d9962c8%}
## Add
Add functions that use the full-adder. Not exactly efficient because it uses a ripple-carry.
{%gist wusyong/d81adecf974396f48e549a55da6aef6c%}
## Sub
Subtract functions expressed as A - B is equivalent to A + (-B)
{%gist wusyong/ea0bb8901d7899d3161972666b348980%}
## Mul
Multiply functions that use elementary school style multiplication. Not very optimal, but it works and allows for templating.
{%gist wusyong/e0e0228d0e583f50a912d6e53b135a70%}
## Factorial
Example factorial function
{%gist wusyong/b3e726dfcbefa3d9459eee44f18b811b%}
## Fibonacci
Example Fibonacci function
{%gist wusyong/ef1ccdfa4de2b6e8ff92003e03b492d7%}