Are Two Flip-Flops Sufficient for a Modulo 4 State Machine?

  • Thread starter Thread starter success2be
  • Start date Start date
  • Tags Tags
    Per State
AI Thread Summary
Two flip-flops can represent four states, which is sufficient for a modulo 4 state machine that counts the number of 1 inputs from two inputs, X and Y. The output Z should be 1 when the count of 1 inputs is a multiple of 4, indicating that a third flip-flop may be necessary to handle the reset state and any potential illegal states. The design must ensure that if the machine enters an unused state, it resets to a legal state. Clarification is needed on how Z outputs 1 based on the input conditions, as the requirement may not be fully understood. Proper state management is crucial for the functionality of the state machine.
success2be
Messages
9
Reaction score
0
How many flip-flops do I need based on the following requirement? I'm thinking 2 flip-flop since each flip-flop can be a 0 or 1. So each flip-flop holds 2 states.

Design a clocked synchronous state machine with two inputs, X and Y, and one output, Z. The output should be 1 if the number of 1 inputs on X and Y since reset is a multiple of 4, and 0 otherwise.

At first glance, you might think the machine needs an infinite number of states, since it counts 1 inputs over an arbitrarily long time. However, since the output indicates the number of inputs received modulo 4, four states are sufficient.
 
Engineering news on Phys.org
I think it may require one more FF for a total of three FFs. Hint -- don't forget the Reset state in your state diagram...
 
Oh, and with 3 FFs, you will end up having some unused states. Be sure to design your logic circuit so that if you end up in one of those illegal states, you vector back to a legal state (usually the Reset state).
 
I don't think I'm understanding the requirements correctly.

When does Z output 1? It reads as if Z outputs 1 when X & Y are 1, but then why do I need 4 states / 4 modulus?
 
Here's a little bigger hint, but hopefully not the whole answer. I'd start with a list of the states something like the following:

0 = 0b000 = reset or idle state (or sum=0 for multiple clocks)
1 = 0b001 : sum=sum+X+Y=multiple of 1; Z=0
2 = 0b002 : sum=sum+X+Y=multiple of 2; Z=0
3 = 0b003 : sum=sum+X+Y=multiple of 3; Z=0
4 = 0b004 : sum=sum+X+Y=multiple of 4; Z=1
5 unused state
6 unused state
7 unused state
 
Hi all I have some confusion about piezoelectrical sensors combination. If i have three acoustic piezoelectrical sensors (with same receive sensitivity in dB ref V/1uPa) placed at specific distance, these sensors receive acoustic signal from a sound source placed at far field distance (Plane Wave) and from broadside. I receive output of these sensors through individual preamplifiers, add them through hardware like summer circuit adder or in software after digitization and in this way got an...
I have recently moved into a new (rather ancient) house and had a few trips of my Residual Current breaker. I dug out my old Socket tester which tell me the three pins are correct. But then the Red warning light tells me my socket(s) fail the loop test. I never had this before but my last house had an overhead supply with no Earth from the company. The tester said "get this checked" and the man said the (high but not ridiculous) earth resistance was acceptable. I stuck a new copper earth...
Thread 'Beauty of old electrical and measuring things, etc.'
Even as a kid, I saw beauty in old devices. That made me want to understand how they worked. I had lots of old things that I keep and now reviving. Old things need to work to see the beauty. Here's what I've done so far. Two views of the gadgets shelves and my small work space: Here's a close up look at the meters, gauges and other measuring things: This is what I think of as surface-mount electrical components and wiring. The components are very old and shows how...
Back
Top