Questions tagged [state-machines]

A finite state machine (or state machine) is a very generic term for any process (electronic or otherwise) whose output is not simply a function of its current inputs, but also depends on its past history. In other words, it has "memory", or internal state information.

Filter by
Sorted by
Tagged with
2 votes
1 answer
121 views

Sequence detector which detects sequences 100 and 111

I need to design a pattern detector that recognizes 100 and 111 bit patterns, even overlapping ones. I drew the state diagram as shown in the image and created the related table Could you tell me if ...
0 votes
1 answer
51 views

Trouble with FSM circuit using Schmitt trigger clock

I'm having some trouble with my circuit based on the design below, that I built for the lab. I'm using a Schmitt trigger clock. I built the circuit on a breadboard and connected it to the clock and ...
1 vote
1 answer
81 views

Show that specific functions are correct for a race-free Moore machine

Context: The goal here is to create a Latch that holds a state. We have two inputs x1, x2 and two outputs f1, f2. When (x1, x2) = (0, 1) or (x1, x2) = (1, 0) the outputs should be the same. When the ...
1 vote
1 answer
24 views

FSM for carpark system with 2 sensors

Basically, I want to design a system where a vehicle goes through one of the sensors, then both, then leaves one, leaves both and finally counter goes up by 1. I've been able to draw the graph below. ...
1 vote
1 answer
193 views

Multiplication 32x32 Mealy machine using 16x8 multiplier Verilog code

I am trying to implement a multiplication 32x32 Mealy machine using a 16x8 multiplicator in Verilog. I wrote the arithmetic part and the FSM part + a code to connect both and a test bench, but when I ...
1 vote
1 answer
344 views

Why are Mealy's number of states less than Moore's number of states in finite state machines? [duplicate]

I was doing an assigment for my digital logic design course. One of the questions was to design a circuit using Moore's state machine and another one doing the same function using Mealy's state ...
1 vote
2 answers
182 views

Could a CPU execute the fetch-execute cycle without a microsequencer/microcode?

VERY SPECIFIC QUESTION, PLEASE READ THROUGH ALL OF IT From wikipedia: "The sequence of operations that the control unit goes through to process an instruction is in itself like a short computer ...
1 vote
1 answer
85 views

Is this a correct FSM graph?

This is question from H.ROOTH book Fundamentals of Logic Design. A sequential circuit has one input (X) and one output (Z). The circuit examines groups of four consecutive inputs and produces an ...
  • 174
0 votes
1 answer
103 views

Design using 5x1 Mux, would this have any complications?

I am building a stopwatch with 5 counters. All are BCD counters with the exception of 1 modulo-6 counter (10ths, 1s, 10s, 1mins, 10mis.) I intend to pass these to the 7 segment displays on my board. ...
1 vote
1 answer
91 views

Same behavior, different synthesis outputs, state machine coding style in VHDL

In an old course book on VHDL I've been revising, the author discussed the effect of coding style on the actual synthesis output of state machines. The example discussed in the book is a classic Mealy ...
  • 55
1 vote
2 answers
151 views

Using an SN74HC595 as a single-wire state machine

I have an SN74HC595 shift register, and I want to use it to replace a microcontroller to save space and cost, since a microcontroller isn't really needed in my application. The application is a system ...
0 votes
1 answer
234 views

Issues with State Machine on FPGA

I've been tasked with making a state machine following the design requirements shown in the screenshot. I have everything mostly working and the simulation worked as expected. However, when I program ...
-5 votes
1 answer
291 views

Polling a button and delaying/switching based on the input. Millis? Delay and loop counter? [closed]

So this is the setup: I previously asked a question about this assignment. THIS IS A NEW QUESTION. THIS IS NEW CODE. ONLY THE IMAGES ARE THE SAME. I originally approached this using an interrupt on ...
0 votes
1 answer
83 views

FSM state assignment techniques, which one should I use?

I'm currently studying finite-state machines at my university and the topic of state assignment optimization came up today. Apparently there are several technique for finding the correct state ...
-10 votes
3 answers
522 views

Does this combinational lock circuit contain any memory?

[The purpose of this Q&A is to illustrate a subtle principle in Computer Science.] I am building a lock circuit using a 4-bit, active HIGH digital comparator. The first input of the comparator is ...
  • 2,374
-7 votes
2 answers
841 views

Is a combinational logic circuit a Finite State Machine? [closed]

Is a combinational logic circuit a Finite State Machine? In other words, is the class of combinational circuits a subset of the class of Finite state machines?
  • 2,374
0 votes
1 answer
137 views

How to Setup the following Finite State Machine

The question goes as follows: Design a finite state machine (FSM) with two inputs (x and y) with an output z, which is asserted every time x and y change state to opposing values at the same time. A ...
0 votes
1 answer
149 views

Access VHDL FSM state type in SystemVerilog testbench?

I have a VHDL block that implements a state machine, with states defined as a type and the current state as a signal of that ...
0 votes
2 answers
339 views

Concatenation with non-blocking assignment

I'm teaching myself Verilog with HDLbits and tackling this problem. According to this post, assignment with the LHS of the expression as a concatenation should work. In practice I've used this many ...
2 votes
0 answers
224 views

block diagram model for elevator FSM

I have tried to design the block diagram for an elevator FSM as outlined by the steps provided by Mikef in this Stack Exchange post: SystemVerilog Elevator FSM issues with conceptual design and ...
-2 votes
1 answer
274 views

SystemVerilog Elevator FSM issues with conceptual design and translation to code

So I'm trying to create a FSM elevator system (single elevator 5 floors) in SystemVerilog and I'm having trouble mapping out how to write the code. In a traditional Moore or Mealy style FSM I can see ...
4 votes
4 answers
784 views

What's importance of finite state machines (FSM) with respect to embedded systems implementation?

I was studying a project that involves implementation of a digitally controlled bridgeless power factor correction (BL PFC) converter. It uses PWM to drive the gate driver of the MOSFET switch and ...
1 vote
2 answers
693 views

FSM vs Pipeline

I am new to the world of HDL. I am currently working on implementing AES in Verilog code. I manage the flow of my logic using varying FSMs. Given this approach I currently have to wait for the first ...
0 votes
2 answers
85 views

Handling of complementary errors in embedded software

I've to design a firmware for an embedded device which may be in different error conditions at the same time. Each error condition requires to set the hardware components of the system into different ...
  • 125
0 votes
2 answers
1k views

Why does Moore Finite State Machine need more states than Mealy Finite State Machine?

I was reading about finite state machines. I read about Moore and Mealy machine and also the state representation. I read that in the Moore machine the output depends on the present state only and in ...
0 votes
1 answer
69 views

Finite State Machine and Robotics [closed]

I have been wondering if I have for example to calculate one sum and a multiplication, I would have two different states, and if so, how would my truth table be, for example if I have a register tot ...
0 votes
2 answers
137 views

how to implement several large state machines in hardware?

There are several ways to encode state machines. However, since a circuit is required to decode the next state and output, implementing a bigger state machine would possibly reduce fmax of a design ...
  • 1,557
0 votes
0 answers
221 views

Converting a Mealy machine to a Moore machine, conflicting states

I need to convert the following Mealy machine to a Moore machine. (see picture). The problem is state b. It has two conflicting states (1 pointing from a and c, 0 pointing from b itself). Since, when ...
0 votes
0 answers
731 views

FSM binary number divisible by 5 truth table

I am having trouble seeing if my truth table based on the exercise's instructions is correct (mostly because the instructions are really confusing me and the TA's explanation really didn't help, this ...
1 vote
1 answer
118 views

How does the JTAG TAP react to clock cycling, and why am I unable to get an instruction through?

I am writing a program for bit-banging a JTAG interface. As far as I understood the JTAG interface, it should act like this: On clock rise, the TDI and TMS inputs are sampled, if Shift-IR or Shift-DR ...
1 vote
0 answers
163 views

State machine correct? 4b'1001 sequence detector

[![enter image description here][1]][1] Is this a correct state machine correct for detecting the 4 bit sequence 4b'1001? If any bit is out of sequence reset to the initial state. Once the last bit of ...
2 votes
1 answer
199 views

Long enumeration in VHDL to recognize a state machine

In order that Quartus II recognizes a state machine in a case / when statement the case must be applied on an enumerated type. In my code I am using a case on integer number going from 0 to 230. And ...
6 votes
3 answers
709 views

How can I convert a 4-digit BCD number to Binary in hardware? (using 74LS ICs and GAL22V10 ICs)

As the title suggests, I need to convert a 4-digit BCD number to binary. I am aware of the doubble-dabble algorithm (https://en.wikipedia.org/wiki/Double_dabble), and that if you use it backwards you ...
2 votes
0 answers
90 views

Problem with designing finite state machine

I'm learning now finite state machines and I'm stuck with this exercise from a book "Digital Design and Computer Architecture" by David and Sarah Harris: First I tried to solve it without ...
  • 33
2 votes
1 answer
289 views

Why should we not change inputs to a sequential circuit (Moore machine) at the clock edge?

The code included here takes a bit stream of binary digits, Least Significant Bit (LSB) first, and outputs the two's complement of the complete stream, also LSB first. A Moore State diagram is ...
0 votes
1 answer
271 views

Is state machine based sequence detector easier to verify than shift register based one?

Suppose I have two versions of sequence detectors: one is based on let's say Moore machine and the other one is based on simple shift register & comparator. Which one among these is easy to verify ...
  • 1
0 votes
2 answers
218 views

Can FSMs be Timed and Recursive?

I am reading a textbook Circuit Design with VHDL, 3rd Edition by Volnei Pedroni. There, he claims that there exist 3 categories of finite-state machines - namely, regular, timed (where the output ...
  • 111
1 vote
2 answers
346 views

Designing a Combination Lock FSM: Converting State Diagram to Logic Gates

I am trying to design a Synchronous combination lock for my digital logic class. I have the state diagram, as I understand how to draw out the logic which I want to follow. However, I am struggling to ...
0 votes
2 answers
125 views

Converting momentary button presses to states

The goal is to implement a circuit in hardware with 2 inputs (A, B) and 2 outputs (A On, B On). An input (button press) toggles it's respective output, but also turns off the other output. State ...
  • 504
0 votes
2 answers
74 views

Potential risk of state machines [closed]

What are the potential risks when implementing a 12-states ?First of all I will need then 4 flip flops to draw my circuit giving a total of 16 states machines meaning that 4 states will be unused . ...
  • 15
0 votes
2 answers
68 views

Systematic ways to design a finite automaton whose input-output function or relation is a given one? [closed]

Given a function or relation, are there some systematic ways to design a finite automaton whose input-output function or relation is the given function or relation, assuming there is at least one such ...
  • 349
5 votes
2 answers
10k views

'1011' Overlapping (Moore) Sequence Detector in Verilog

I'm designing a "1011" overlapping sequence detector, using Moore Model in Verilog . The FSM that I am trying to implement is as shown below :- Verilog Module :- ...
5 votes
2 answers
33k views

'1011' Overlapping (Mealy) Sequence Detector in Verilog

I'm designing a "1011" overlapping sequence detector,using Mealy Model in Verilog. The FSM that I'm trying to implement is as shown below :- Verilog Module :- ...
-1 votes
1 answer
70 views

Verilog state machine not as expected

I have a simple problem, but not able to debug. I am not a novice in Verilog, but this problem seems surreal and weird. I have tried all I could to debug, but still cannot figure it out, so sking for ...
  • 13
-2 votes
4 answers
173 views

What is a "finite-state machine" and what are its use cases?

On Wikipedia, a finite state machine is defined as "any device storing the status of something at a given time." However, I don't see how other components, such as logic gates, flip flops, or ...
-1 votes
2 answers
175 views

Test Verilog FSM for state with no reset

My professor gave us several Verilog test files to write Verilog test benches for. In the test bench, we're supposed to initialize the state to 0, apply random inputs, and check to see if we have ...
0 votes
1 answer
74 views

Having trouble with deriving the state diagram for an exam problem

The Problem: Derive the state diagram for a circuit that takes one input, A and gives out one output X, X is to be one, if and only if it detects a sequence "101" in A. Understanding The problem: if ...
  • 297
0 votes
2 answers
789 views

Designing a Moore sequence detector using three always blocks

Trying to implementing a Moore state machine using three always blocks. The Moore state machine has two inputs (ain[1:0]) and one output (yout). The output yout begins as 0 and remains a constant ...
  • 1
0 votes
1 answer
2k views

State Table & Karnaugh-map for Finite State Machine

I am trying to create a Finite State Machine that is able to check if a number string is valid. For example, it would accept 3, 4.65 or 8.93e-10. So far I have created a transition table for the ...
  • 103
0 votes
2 answers
85 views

Determining FSM states hint

I want to get the idea behind determining states of a FSM. I would appreciate a hint for the following problem as to where to look for the states. "A FSM should send out a signal to open a door. If ...

1
2 3 4 5