[1][1]I've been trying to make a timer that starts from 0 then counts down at 9 to 0. I've been struggling to make it.  I made state tables and diagrams and for the flipflops, but when implementing to a simulator, it just doesn't give me the output I want.

I've tried making the don't cares (10-15) as 0 but still doesn't work.

Here's the state diagram:

[![enter image description here][2]][2]

Here's the state table:

[![enter image description here][3]][3]

I followed the kmap results in the simulator but still can't get it to work.

Here's my state table for the jk flipflop

[![enter image description here][1]]

kmaps using logic friday:
[![enter image description here][4]][4]

Simulation in proteus, it counts down from 0 to 9 but gets stuck at 3 and 2 going back and forth.

[![enter image description here][5]][5]


I got it working thank you all. a lot of misinputs was present in making the state table, glad I found it.

Final Results:

[![enter image description here][6]][6]
[![enter image description here][7]][7]


  [1]: https://i.sstatic.net/TOzgP.jpg
  [2]: https://i.sstatic.net/ejU77.jpg
  [3]: https://i.sstatic.net/gCmFG.jpg
  [4]: https://i.sstatic.net/6bQIy.jpg
  [5]: https://i.sstatic.net/r9iXs.png
  [6]: https://i.sstatic.net/jhptw.jpg
  [7]: https://i.sstatic.net/evKDv.png