State Machine Design for Repeating Sequence: 0,2,4,6,1,3,5,7 with 4 Bit Counter

In summary, the conversation discusses designing a state machine that goes through a specific sequence repeatedly. The student considers using a 4-bit counter as input and sets up truth tables, but encounters a problem in the sequence after the first complete 3-2 sequence. They then consider using a 3-bit counter that stops at 5 and starts back at 1, and someone suggests using a simple microprocessor instead. The student later solves the problem by using a second state machine for the input.
  • #1
Rocket254
33
0

Homework Statement



Design a state machine that repeatedly goes through the following sequence: three repeats of 0,2,4,6 followed by 2 repeats of 1,3,5,7. An observer watching the machine should see the states over and over: 0,2,4,6,0,2,4,6,0,2,4,6,1,3,5,7,1,3,5,7...


The Attempt at a Solution

I've decided to use a 4 bit counter as the input to the machine. I have set up the following truth tables:EDIT: it is chewing my formatting to pieces. The values on a line by themselves are the counter values.Counter current state next state

00
000 010
001 011
010 100
011 101
100 110
101 111
110 000
111 000
01
000 010
001
010 100
011
100 110
101
110 000
111
10
000 010
001
010 100
011
100 110
101
110 001
111
11
000
001 011
010
011 101
100
101 111
110
111 001
I seem to run into a problem after the first complete 3-2 sequence.(Thus why the truth table isn't completed.) When the counter is at 00, 01, and 10, the sequence is at 0246. It then swaps to the 1357 sequence at counter values 11 and 00. After that, instead of counting three more 0246 sequences, it swaps back to 1357 at the end of counter value 10. This problem would be simple if the sequences alternated every 4 times but, my machine seems to overlap itself when the counter runs back through the values. Any ideas how to correct the problem?
 
Physics news on Phys.org
  • #2
I may have found an alternate way to solve this. Does anyone know if there is a way to make a 3 bit counter stop at 5 and start back over at 1?
 
  • #3
Do you have to use a counter? It seems this would be a very easy problem with a simple microprocessor.
 
  • #4
Didn't see the reply in time but I solved it anyway. I decided to use a second state machine for the input that rotated through 5 states of 0,0,0,1,1


Thanks for the help.


JH
 

1. What is a state machine design?

A state machine design is a modeling technique used in computer science to represent the behavior of a system or process. It consists of a set of states, events, and transitions that define the possible sequences of actions that the system can perform.

2. Why is a state machine design important?

A state machine design is important because it helps to break down complex systems into smaller, more manageable parts. It also allows for better understanding and visualization of the system's behavior, making it easier to identify and fix any potential issues.

3. What are the key components of a state machine design?

The key components of a state machine design include states, events, and transitions. States represent the different stages or conditions of the system, events trigger a change from one state to another, and transitions define the rules for transitioning between states.

4. What are some common applications of state machine designs?

State machine designs are commonly used in software development, robotics, and artificial intelligence. They are also utilized in various industries such as manufacturing, telecommunications, and transportation for modeling and controlling complex systems.

5. How do you create a state machine design?

The process of creating a state machine design involves identifying the states, events, and transitions of the system, and then mapping out their relationships in a visual diagram. This diagram can be created using various tools such as UML diagrams, flowcharts, or specialized state machine design tools.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
26K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
8K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Quantum Physics
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
17
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
Back
Top