# I need help analyzing a circuit

Joined Jun 18, 2019
10
Hello everyone .
So I have some trouble analyzing the circuit in the picture that follows . Basically the exercise asks what's the purpose of this circuit .
I also made the state table and basically I found out that :

Present state
y2 y1
0 0
0 1
1 0
1 1

For x = 0
Next state
y2 y1
0 0
0 1
1 1
1 1

For x = 1
Next state
y2 y1
1 0
1 0
1 1
1 0

Output f = 1 when y2y1 = "00" or "11" .

After making the state diagram my conclusion is that the circuit acts as an oscillator between the states "11" and "10" when x = 1 ,but stays at state "11" if x = 0 . Am I right ? Is there anything else more important going on I should notice ? What do you think? Thank you in advance for taking the time to check this out !

#### WBahn

Joined Mar 31, 2012
26,398
I don't see any 'y1' or y2' signal on your diagram and my crystal ball is in the shop. Please define your signals.

Joined Jun 18, 2019
10
I don't see any 'y1' or y2' signal on your diagram and my crystal ball is in the shop. Please define your signals.
You're right,i'm sorry !
As y1 i have considered the output of the A JK-FF and y2 is the output of B JK-FF ,

#### WBahn

Joined Mar 31, 2012
26,398
It looks like your analysis is correct, at least as far as it goes.

One thing to always consider are the other states. For instance, your system could power up in any of the four possible states, so what happens if x=0 at power up. What is the output going to be?

Joined Jun 18, 2019
10
It looks like your analysis is correct, at least as far as it goes.

One thing to always consider are the other states. For instance, your system could power up in any of the four possible states, so what happens if x=0 at power up. What is the output going to be?
Well if my state is "00" or "01" then i will remain like this . If it's "10" then i will move to"11" and if it's "11" already then again no change . But am i supposed to understand what an abstract diagram like the one from this example means ? If it's a counter ,or a sequence detector then okay maybe it's not that hard, but in the general case couldn't be just anything ? So what's the point of knowing how to reverse engineer these circuits ?

#### WBahn

Joined Mar 31, 2012
26,398
Whenever I see problems like, "Given the following sequence of N numbers, what is the next number?" I cringe because the next number can literally be anything you want it to be using an N-degree polynomial. My first thought when I saw this problem was to respond something like, "clearly it lets demons from a parallel dimension enter ours when x=0 and drives them back into their own when x=1," precisely because, as you've noted, there is really no way to tell what the purpose of a circuit is, only what its behavior is.

I suspect the purpose here is just to get practice in determining how a circuit is expected to behave, which is actually a very valuable skill. I can't count the number of times that I've had to answer the question of "what does this circuit actually do"? as distinct from "what was this circuit meant to do?" More often than not the circuit in question was one of my own design that wasn't doing what it was intended to do -- so when the reason wasn't quickly apparent, a useful next step is to throw away all preconceptions and ask what the circuit in front of you actually does -- and in the process you often hit an ah-hah moment when you realize why it does what it does instead of what you wanted it to do. This is why I asked about the other states because those "unused" states are often the cause of the misbehavior, and so they deserve special attention.

As for the broader point of reverse-engineering something, that depends on why it is being reverse engineered. Most of the time you have quite a bit of context to work from, such as knowing what it does and trying to figure out how it does it. There can be lots of reasons why you are in such a situation, including trying to maintain equipment for which parts and manuals are no longer available and for which replacement with more modern hardware is not an option.

An example is some of the electronics in aging military hardware. Some of that equipment was designed and built more than half a century ago and the companies that did so are no longer in existence and their design drawings and maintenance manuals went with them, especially if the equipment was rugged and reliable as the lack of documentation didn't cause any problems. But now as some of that equipment starts to fail and stocks of replacements dwindle, you need to either figure out how to repair it or produce very exacting specs from which drop-in replacements can be designed from. Even if you have the original specs for the equipment, that probably isn't good enough because almost any equipment is going to have behaviors that were not spec'ed but which can be important to the continuing maintenance -- this is particularly the case with electronic equipment that interfaces in some manner or fashion with other equipment from the same manufacturer, or even just with the test equipment supplied for that equipment, which often has undocumented features or implement documented features in undocumented ways.

Last edited:

Joined Jun 18, 2019
10
Whenever I see problems like, "Given the following sequence of N numbers, what is the next number?" I cringe because the next number can literally be anything you want it to be using an N-degree polynomial. My first thought when I saw this problem was to respond something like, "clearly it lets demons from a parallel dimension enter ours when x=0 and drives them back into their own when x=1," precisely because, as you've noted, there is really no way to tell what the purpose of a circuit is, only what its behavior is.

I suspect the purpose here is just to get practice in determining how a circuit is expected to behave, which is actually a very valuable skill. I can't count the number of times that I've had to answer the question of "what does this circuit actually do"? as distinct from "what was this circuit meant to do?" More often than not the circuit in question was one of my own design that wasn't doing what it was intended to do -- so when the reason wasn't quickly apparent, a useful next step is to throw away all preconceptions and ask what the circuit in front of you actually does -- and in the process you often hit an ah-hah moment when you realize why it does what it does instead of what you wanted it to do. This is why I asked about the other states because those "unused" states are often the cause of the misbehavior, and so they deserve special attention.

As for the broader point of reverse-engineering something, that depends on why it is being reverse engineered. Most of the time you have quite a bit of context to work from, such as knowing what it does and trying to figure out how it does it. There can be lots of reasons why you are in such a situation, including trying to maintain equipment for which parts and manuals are no longer available and for which replacement with more modern hardware is not an option.

An example is some of the electronics in aging military hardware. Some of that equipment was designed and built more than half a century ago and the companies that did so are no longer in existence and their design drawings and maintenance manuals went with them, especially if the equipment was rugged and reliable as the lack of documentation didn't cause any problems. But now as some of that equipment starts to fail and stocks of replacements dwindle, you need to either figure out how to repair it or produce very exacting specs from which drop-in replacements can be designed from. Even if you have the original specs for the equipment, that probably isn't good enough because almost any equipment is going to have behaviors that were not spec'ed but which can be important to the continuing maintenance -- this is particularly the case with electronic equipment that interfaces in some manner or fashion with other equipment from the same manufacturer, or even just with the test equipment supplied for that equipment, which often has undocumented features or implement documented features in undocumented ways.
Yea i definitely get what you mean . It really gets annoying when you're given ill defined questions .

So these problems can be useful for learning to troubleshoot designs . Interesting, i didn't think it that way initially . It helps a lot having some context and not just analyze stuff just because you can . I will also keep in mind your advice about the unused states. We haven't really dived in various behavioural abnormalities that can occur in digital circuits just yet . This semester was mostly problems like that i posted and implementing them with VHDL using Quartus. And you're right, the time i spent deciding what i want my circuit to do and designing it, was by far less compared to the time needed for verification . And that was just functional , i can't even imagine what pain in the ass a full verification check can be !

#### Marley

Joined Apr 4, 2016
446
I don't see any 'y1' or y2' signal on your diagram and my crystal ball is in the shop. Please define your signals.
My crystal ball has been sent off for UKAS calibration. Seems to be giving me incorrect readings.

Last edited:

#### ci139

Joined Jul 11, 2016
1,696
just perhaps it might be
that when you add a realistic propagation delays
the circuit would have a different function near the upper bandwidth limit