# Why choosing 1 or 0 for the dont care values give different function in a Karnaugh Map?

If I have a Karnaugh Map with dont care values . I can give any dont care the value 1 or 0 depend on my needs. But why if I will choose 1 for the dont care values, it will give me a function $f$

And if I will choose 0 instead, the function I will get will be different ?

We assign the value $1$ to a don't care in order to try and increase the size of prime implicants, thus reducing the complexity and cost of the circuitry. Don't cares by definition do not affect the behavior of a combinational circuit, so treating them as $1$'s and $0$'s is good. On the other hand, if you're designing a sequential circuit, problems in wiring may cause your machine to jump to an unexpected state, if don't cares are treated as such, and not assigned a value of $0$ and $1$ then the machine will be stuck in that state, and will not function properly. You can either set the don't cares in a way to always return to the initial state in the loop (costly, but a time-saver), or treat them as $1$'s and $0$'s to increase prime implicants (cheaper, but has to go through the loop from an arbitrary point before returning to start).