Electronic – Given a shift register- Create a circuit to check whether 4 first bits are equal to the last 4

computer-architecturedigital-logic

I hope this is the place to ask such a question.

Given a shift register- within 8 clock pulses 8 bits will enter this register, I need to make a circuit with this register, and other 3 flip-flops such that its exit line would be 1 if the first 4 bits are equal to the last 4.

This is an example of possible solution.

My question for you is: How come that only at the end of the 8th pulse a value would go out to the "equal" line? (or that in this solution- successes consider as output of "1111"?)

enter image description here

Best Answer

What exactly are you given to work with? Your diagram shows some gates in addition to the shift register and the flip flops. If the shift register bits are all exposed, you could simply use four XOR gates and a quad OR or NOR gate. No flip flops required. Otherwise, do you need to know, at any given time, whether the last four inputs match the previous four, or will you only need to ascertain that every four clock pulses, or every eight, or what?

Conceptually, I think your best bet may be to use your flip flops to make a counter which will increment up to a max of four whenever the input to the shift register matches the signal four previous, and will reset to zero otherwise. Without understanding the exact requirements, though, it's hard to say for sure.