<p>What you're describing is known as a cardinality constraint. There are many ways of encoding these in CNF. As a starting point, some of these encodings are explained in</p>

<ul>
<li><a href="http://www.carstensinz.de/papers/CP-2005.pdf" rel="nofollow noreferrer">http://www.carstensinz.de/papers/CP-2005.pdf</a> and</li>
<li><a href="https://arxiv.org/pdf/1012.3853.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1012.3853.pdf</a>.</li>
</ul>

<p>Many are implemented in the <a href="https://pysathq.github.io/" rel="nofollow noreferrer">PySAT</a> python toolkit</p>

<ul>
<li><a href="https://pysathq.github.io/docs/html/api/card.html" rel="nofollow noreferrer">https://pysathq.github.io/docs/html/api/card.html</a></li>
</ul>
How to using CNFs to describe addition
<p>Many papers are using SAT, but few mentioned how to convert an addition to CNF.</p>

<p>Since CNF only allows AND OR NOT operation, it is difficult to describe addition operation. For example,</p>

<pre><code>x1 + x2 + x3 + ... +x1599 &lt; 30, xi is binary.
</code></pre>

<ol>
<li>Map these equations into a Boolean circuit.</li>
<li>Apply Tseitin's transformation to the circuit and convert it into DIMACS format. </li>
</ol>

<p>But is there any way to read the results? I do think it is possible to read the results if all the variables are defined by ourself, so figuring out how to convert a linear constraint to SAT problem is necessary.</p>

<p>If there are 3 or 4 variables, i.e. x1+x2+x3 &lt;3, we can use truth table to solve this conversion. Also, a direct way is that chose 29 (any number smaller than 30) variables from 1600 variables to be 1, the others to be 0. But there are too many possibilities which makes this problem hard to solve.</p>

<p>I have used STP, but it can only give 1 answer. As the increasing number of variables and clauses, it costs a long time for STP to run.</p>

<p>So I tried to use SAT to solve the cnf given by STP, it can give out answers in a minutes. But the results cannot be read.</p>

<p>In the end, I found some paper, 
1. Encoding Linear Constraints with Implication Chains to CNF,
2. SAT-Based Techniques for Integer Linear Constraints. This may be helpful.</p>