On 6/16/06, Tom Cook <[EMAIL PROTECTED]> wrote:


To shift this into C:

char whatsit( char a, char b, bool d )
{
  if( d ) return a & b;
  else return (a + b) & 0x0F;
}

The carry bit from the addition is being lost (hence the & 0x0F at the end
of the addition).  Also char is 4 bits wider than the types of the Verilog,
but it's the nearest C equivalent.

Do I win?

In this game, EVERYBODY wins.  :)

(Wasn't that just the cheeziest thing to say?  :)
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to