# synchronous counter using JK flipflops for generating Prime number between 1 and 13

Status
Not open for further replies.

#### atifqau

##### Newbie level 3
hello i am new to this forum. i am working on a project. Synchronous counters using 4 JK flip flops and the counter should generate prime number between 1 and 15. i am really confused. Can any body explain me the basic concept behind the prime number generation using synchronous counters. thanks

#### ads-ee

##### Super Moderator
Staff member
4 Flip-flops means a 4-bit binary number. A 4-bit binary number can display numbers from 0b0000 (0) to 0b1111 (15). The prime numbers that are below 15 are: 1, 2, 3, 5, 7, 11, and 13.

Build a truth table that has each of those as the input and the output is the next value in the sequence. Convert that truth table to a circuit using the JK flip-flops.

#### atifqau

##### Newbie level 3
i have made the truth table for the present states and the next states, and inputs to the flip flops. K-map is also drawn for each of the flip flop inputs. Now the problem is i stuck in the circuit of the up counter. how would i change the continuous sequence to a prime number sequence. thanks

#### ads-ee

##### Super Moderator
Staff member
You don't use an up counter k-map you create a k-map from the truth table of the 1-2, 2-3, 3-5, 5-7, 7-11, and 11-13 transitions.

Have you studied any logic design books or tutorials? If not you may want to go back and do so, this is a pretty basic logic design problem.

#### atifqau

##### Newbie level 3
i have studied a lot of stuff related to the topic. i got that, one more thing i considered all the possible states (16 combinations) as a present state and the prime numbers as the next state. Then insert the flip flop values by considering the excitation table. Am i going on the right track?

#### ads-ee

##### Super Moderator
Staff member
i have studied a lot of stuff related to the topic. i got that, one more thing i considered all the possible states (16 combinations) as a present state and the prime numbers as the next state. Then insert the flip flop values by considering the excitation table. Am i going on the right track?

Yes, you can/should assign all the possible states, but the "unused" states should be assigned so they eventually go back to one of the "used" states (i.e. all states go to a prime number).

Now about the second part of your question, it sounds right, but I haven't used JK flip flops for 25+ years so I would have to go back and figure out how to translate a truth table/k-map into the corresponding JK flip-flop based design.

- - - Updated - - -

actually the mapping of a JK into a D is pretty simple. https://www.circuitstoday.com/flip-flop-conversion

Status
Not open for further replies.

Replies
1
Views
2K
Replies
3
Views
3K
Replies
4
Views
6K
Replies
4
Views
3K
Replies
1
Views
2K