2 bit hot encoding using SV constraints

In reply to Akhil Mehta:

You can solve it by using someone else to do your work for you. :)

When you say " without using in-built function" do you mean any in-built function, or just not $countones?