Strange behaviour with 32 bit, splitter and NOT gates

If you have something to say about LogicCircuit program or you know how to improve it please share it here.
Post Reply
Volvagia
Posts: 15
Joined: Sat Jul 12, 2014 3:42 am
Location: Österreich ("Austria")

Strange behaviour with 32 bit, splitter and NOT gates

Post by Volvagia »

Hello.
I'm not sure, whether this is my or the applications fault.
After I have build a 4 Bit-CPU, I would try to build a 32 Bit.

But when I click on this wire at runtime to show his currently data,

Image

I get mostly AssertionFailed-Exception,

Code: Select all

LogicCircuit.AssertException: AssertionFailed
   bei LogicCircuit.CircuitFunction.ToText(IEnumerable`1 probeState, Boolean showFormatPrefix)
   bei LogicCircuit.WireDisplayControl.TimerTick(Object sender, EventArgs e)
   bei LogicCircuit.WireDisplayControl.Start()
   bei LogicCircuit.EditorDiagram.SymbolMouseDown(Symbol symbol, MouseEventArgs e)
   bei LogicCircuit.EditorDiagram.DiagramMouseDown(MouseButtonEventArgs e)
   bei LogicCircuit.Mainframe.DiagramMouseDown(Object sender, MouseButtonEventArgs e)
sometimes a IndexOutRangeException:

Code: Select all

System.IndexOutOfRangeException: Der Index war außerhalb des Arraybereichs.
   bei LogicCircuit.CircuitFunction.Binary(IEnumerable`1 probeState)
   bei LogicCircuit.CircuitFunction.ToText(IEnumerable`1 probeState, Boolean showFormatPrefix)
   bei LogicCircuit.WireDisplayControl.TimerTick(Object sender, EventArgs e)
   bei LogicCircuit.WireDisplayControl.Start()
   bei LogicCircuit.EditorDiagram.SymbolMouseDown(Symbol symbol, MouseEventArgs e)
   bei LogicCircuit.EditorDiagram.DiagramMouseDown(MouseButtonEventArgs e)
   bei LogicCircuit.Mainframe.DiagramMouseDown(Object sender, MouseButtonEventArgs e)
("The index was out of array bounds")

And (my real problem), all more significant bits on the multiplexer left above are not connected because the NOT-Gate on the deeper lying 2-bit-multiplexer do not connect/negate his input. But the sub-multiplexer on the lower significant bits of the 32 Bit-MUX use exactly the same circuits.

I don't know what I should do.

Thank you
Attachments
cpu.CircuitProject
(2.08 MiB) Downloaded 1283 times
cpu compressed.zip
(193.24 KiB) Downloaded 1117 times
cpu.png
cpu.png (13.3 KiB) Viewed 17986 times
User avatar
admin
Site Admin
Posts: 417
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: Strange behaviour with 32 bit, splitter and NOT gates

Post by admin »

The problem is understood. If you need to monitor values in this wire or any other that is failing please use probe instead. I’ll fix the issue and make it available in the next release.
Volvagia
Posts: 15
Joined: Sat Jul 12, 2014 3:42 am
Location: Österreich ("Austria")

Re: Strange behaviour with 32 bit, splitter and NOT gates

Post by Volvagia »

Thank you

But why doesn't work the NOT Gates on the 2:1 multiplexers on the lowest "layer" of the 32 bit-multiplexer for the higher 16 bits of the data coming from "Register File"? Is this the same problem?

Image

By the way, I have seen that the truth table generation throws an AssertionFailed-Error too, if the circuit use Tristate and an Out-Port become a high impedance/not connected-signal.
Attachments
mux_not_gates.png
mux_not_gates.png (35.85 KiB) Viewed 17974 times
User avatar
admin
Site Admin
Posts: 417
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: Strange behaviour with 32 bit, splitter and NOT gates

Post by admin »

The not gates are working fine in this case. What you see is result of optimization. Your output from Register file is connected to splitter and only lower bits are connected. The upper bits are not. So the optimizer removed all the gates that are not delivering results to anything user can see.
The issue with truth table is bug also.
Thank you for finding all these bugs.
Volvagia
Posts: 15
Joined: Sat Jul 12, 2014 3:42 am
Location: Österreich ("Austria")

Re: Strange behaviour with 32 bit, splitter and NOT gates

Post by Volvagia »

Thank you for this great application. :)
Sorry, I have overlooked/forgotten, that the ROM has "only" up to 16 address lines.
User avatar
admin
Site Admin
Posts: 417
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: Strange behaviour with 32 bit, splitter and NOT gates

Post by admin »

Sure, BTW if you building CPU and want to program it with assembler language; there is a universal macro assembler where you define commands same way you define any other macro or writing program.
If interested you can download it here: https://bitbucket.org/EugeneLepekhin/fusion/downloads
In the zip file there is a small document explaining the language.
User avatar
admin
Site Admin
Posts: 417
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: Strange behaviour with 32 bit, splitter and NOT gates

Post by admin »

You get the new version with the two bugs fixed and whole bunch of new features added.
User avatar
admin
Site Admin
Posts: 417
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: Strange behaviour with 32 bit, splitter and NOT gates

Post by admin »

BTW I’ve found short wire connecting two Nor inputs on AU Nor(86, 31). The wire is between pin 3 and 4. I guess you did not mean to have it.
Post Reply