Optimize boolean statements I have the following logic:

bool a;
bool b;
int v = 0;

//code here to set the values of a and b...

if(b)
{
    v = a ? 1 : 2;
}
else
{
     v = a ? 0 : 1;
}


I believe that there may be a way to minimize this logic (or rewrite it in a more clever way) that I am not thinking of.
int v = b ? (a ? 1 : 2) : (a ? 0 : 1);


EDIT #1:

As per svick, parsed out conditional operator on separate lines:

int v = b
    ? (a ? 1 : 2)
    : (a ? 0 : 1);


EDIT #2:

Here's one I don't like, but it has no branching whatsoever:

int v = Convert.ToInt32(b) + Convert.ToInt32(!a);