if (vdiv = '0' and vcount = 312) or
(vdiv = '1' and vcount = 313) then
...

PS. vdiv='1' можно опустить...