Ring counters, again!

Incidentally, Bell Labs patented using a NOR gate to reject dis-allowed states in ring counters in 1987:

Given that most D flops have not-Q that's all the patent is, a NOR gate connected from two outputs to clear. for 20 years until 2005 you'd need to ask Bell Lab's permission if you wanna do that! Heh!

Anyway the point is when using discrete flops to build one, perhaps in different IC packages even, I think actively rejecting dis-allowed walks is important thing.

for a four-flop counter I think a quad-input XOR can generate a reset for the dis-allowed states just by "inspection." If your outputs are ever 1010 or 0101 it's gone sideways.

Reply to
bitrex
Loading thread data ...

For longer registers, there is a way to get the thing back to the proper sequence by modifying the feedback from the end.

  1. Using wide AND gates to detect all ones and all zeroes states and using them to turn a set-reset flip-flop which then feeds the shift register serial input.
  2. Using a counter to count to twice the shift register length and using its most-significant bit to feed the serial input.
--

-TV
Reply to
Tauno Voipio

Ah, modify the feedback loop. that's the way to do it.

Reply to
bitrex

My FPGA guys say to set one bit at powerup, and trust that nothing will ever go wrong.

Reply to
John Larkin

A wise man once said 'trust, but verify'. Anything with as many states as a computer, should have a watchdog somewhere. I'm thinking most finite-state-machine reasoning includes similarf wisdom.

An entire (DDR3) generation of memory has the rowhammer feature.

Reply to
whit3rd

quad input xor? all the legal paterns have a hamming distance of one from their neighbours, that's not going to work.

there's 8 allowed states and 8 disallowed states

allowed 0000 1000 1100 1110 1111 0111 0011 0001

disalowed 0100 1010 1101 0110 1011 0101 0010 1001

as they form a ring you only need to detect one of those or a sub-pattern that does not occur in legal paterns such as such as 010x for that 3-input and will do (assuming ~Q outputs are available)

or just use a CD4022 and use resistors from the outputs to make your sine and cosine signals.

--
  When I tried casting out nines I made a hash of it.
Reply to
Jasen Betts

You can't detect these two states exclusively with a 4 input XOR. It's not as simple as you think. What you want to detect is that you have an edge in the chain. The presence of the edge and the state of the last FF determ ines the value fed back to the first FF. When there is one or no edge feed back the last FF inverted. When there is more than one edge feedback a zer o. With only 4 FFs this is not too hard, but it's not a 4 input XOR. Ther e are 16 possible states and only 8 are valid.

I don't know what might be optimal, you can do a Karnaugh map from the trut h table to figure out that.

Set no bits at power up... it's called a reset. All zeros is a valid state in a Johnson ring counter. Detecting an invalid state in such a circuit w ould be at the high end of reliability, but not unheard of. Critical syste ms would want exactly that. In typical systems many other intermittent fai lures are much more likely.

--
  Rick C. 

  - Get 2,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Rick C

Except that gets us back to multiple outputs changing at once with the resulting race and glitching that started us down this rabbit hole.

The only practical, glitchless methods I know of for this use are the thermometer code or the Johnson ring counter. A grey code is glitchless, but I can't see a useful way to apply it here.

--
  Rick C. 

  + Get 2,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Rick C

I'm glad I don't have a Larkin pacemaker fitted. I suppose back-to-back monostables are just as good.

Reply to
Andy Bennet

The main work of the patent above I think was the grunt work of proving mathematically that that particular NOR gate connection can correct for all possible erroneous states, in any length register, and can handle all erroneous states, not just single bit-flip errors.

There are probably other logic configurations that will correct errors for a particular counter, or perhaps even all counters, but if the counter is too long to figure out if it works for all cases by inspection one would have to "do the math."

Reply to
bitrex

Integrated 4000-series Johnson counters are said to use this logic between every 3rd flop stage to error-correct:

Reply to
bitrex

Why not just use a counter/ divider '4017 or '4022?

formatting link

George H.

Reply to
George Herold

The ripple counter and decoder combination is a way to invite glitch problems. The decoded states do not produce the thermometer code (KITT front decoration) needed to create the sine waves.

I suggested at the start of this thread how to create reliable thermometer codes counters.

--

-TV
Reply to
Tauno Voipio

4000 series are too slow at low voltage at the speed I need to go at.

"01" on the final two outputs is either the end of a proper count, or part of an error cycle.

For a four-flop ring that requires a negative-going reset pulse a diode OR gate from not-Q and Q on the last two flops to bang a pulse to ground into CLR when it hits that state seems simple enough...

Reply to
bitrex

The divider has ten outputs, you hang the right R on the output and sum them all into an opamp, AC couple and filter to taste. :^)

I did this several years ago, worked great.

George H.

Reply to
George Herold

Sorry, reverse that. I think.

Reply to
bitrex

What voltage? 74HC4017?

GH

Reply to
George Herold

:

owed

gate

need

in

walks

et

e
x

e resulting race and glitching that started us down this rabbit hole.

thermometer code or the Johnson ring counter. A grey code is glitchless, but I can't see a useful way to apply it here.

Because it will produce glitches in the output on every transition. The ou tputs don't change at the same time exactly. Maybe the timing is significa nt or maybe it's not. The ring counter has no glitches and is still a simp le circuit with a good result. The prospect of disrupting the ring counter is not solved by using a binary counter. If the binary counter gets disru pted it also produces erroneous outputs. I suppose it is a short term disr uption, but it isn't immune from the issue.

--
  Rick C. 

  -- Get 2,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Rick C

1.8, idk if there are any appropriate Johnson counter in the 74LVC series.
Reply to
bitrex

I don't think you look very hard.

formatting link

--
  Rick C. 

  -- Get 2,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Rick C

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.