How to simulate 4 bit ring counter using max+plus II

digital-logicsimulation

I'm newbie with max+plus II and digital modelling world just want to simulate a simple ring counter https://www.dropbox.com/s/47tlv3g7o9zi8gb/all.jpg the ring counter's initial value must set to 1 (input port A) so I can not delete input A as you see the output of dff #3 is connected to the input of dff #0

I keep getting this error:output Q and input A are tied toghther I'v tried using three state buffer to solve this but no luck so far gdf file: https://www.dropbox.com/s/y4zp8x6q5o9uf1y/ringcounterdff.gdf thanks

Best Answer

Read your error report carefully: it complains about an output, 4.Q, tied to another "output", A:5. The simulator complains because you are likely to drive your input A with some values, but flip-flop four is also quite likely to drive that same exact node with its output. What if A wants to drive a 1 while Q.4 wants to drive a 0? That's not acceptable for a simulator.

So what's the solution? Remove input A. As you see in your above schematich input A is not present. You can preload the counter with the appropriate starting status by driving the PRN/CLRN pins accordingly. You should tie all the CLRNs to something anyway.

Alternatively you can use a selector, or multiplexer: its inputs would be A and Q.4, while you should tie its output to D.1
Of course you will have another input, that is the multiplexer control input: this wire controls what your counter is doing:

  • normal operation, i.e. Q.4 tied to D.1, A hanging
  • preload, i.e. A tied to D.1, Q.4 hanging

Just remember: the compiler is your friend, get used to understand it.