Page 1 of 2

Bidirectional circuit in LogicCircuit

Posted: Thu Apr 03, 2014 12:30 pm
by SomeGuy
I'm sorry if I double-posted, my previous post didn't show up and I don't know if I did something wrong or is there any system of post acceptance by moderator.

Hi,

first I must admit I have very little knowledge about electronics and logical circuits, just the basics. I try to learn a little bit and Logical Circuit helps a lot so thanks for this great piece of software.
I hope that I might get some help from you. I need to create sub-circuit for bigger project that has 3 outputs A B and C (every of them has 5 bits but I'd be really happy if I'd succeed even with single bit for every of them). I want signal to pass from A to B and from C to A so B and C are uni-directional and A is bi-directional. For last few days I was trying different concepts with tri-state gates and I couldn't make it work. I'm dying even just to create a<->b bidirectional circuit with control pin and still no success. I was looking for some schematics and information on this forum and in google and I didn't find much that I can deal with (as I said I have little knowledge so more advanced solutions are out of my league). However I found one circuit that seems promising: http://cpuville.com/three_state.htm. Unfortunately after recreating this circuit in Logical Circuit all that I see when I try to run it is that lovely message: "Input pin of (someting,something) connected to blah blah that is not tri state capable". I understand why I see it, two tri state buffers has no tri-state capable inputs but are connected to circuit input AND to other tri-state output at the same time. But I can't find any solution for such circuit without that kind of connection and I'm running out of ideas. I'd be grateful if anyone could help me with that - point me direction or maybe some materials/schematics or so.

Re: Bidirectional circuit in LogicCircuit

Posted: Thu Apr 03, 2014 9:24 pm
by admin
No problem, I’ve deleted the second one. Your very first post needs to be approved by moderator. Once you have it approved all the other posts will be visible right away.
Usually you use tri state buffers to control bus. All the devices connected to bus are usually should be disconnected i.e. try states are in high impedance mode. When the bus logic decided to send a signal from one particular device to the bus it move the correspondent buffers to connected state and hence the device can send it data. Once the operation is done it gets disconnected from the bus again.
The error you are seeing means that you have connected more than output directly to some input. Please make sure all your outputs are connected to the bus via tri state buffers.
I hope I’ve made clearer for you.
Eugene

Re: Bidirectional circuit in LogicCircuit

Posted: Sat Apr 05, 2014 2:12 am
by SomeGuy
Thank you for response! As I said I am aware of why I see this message - for the circuit I linked to it's because both of tri-state gates get one input from another tri-state and the second from regular input that's not buffered by another tri-state and there's a possibility that one tri-state will get two inputs at once.
My problem is that I don't have any idea how to create circuit like that meeting requirements of LogicCircuit. When you look at those schematics I linked to you'll see that the circuit that I'm talking about will work when the configuration is right. Of course, it has a tri state that has one tri-state and one non-tri-state line connected to input, but it's by design and it should work if LogicCircuit just allow you to run it.

So, to be clear, my question is: how to implement that using LogicCircuit?

I'll attach my implementation of those schematics (of course it doesn't work) to make it easier.

Re: Bidirectional circuit in LogicCircuit

Posted: Sun Apr 06, 2014 12:33 am
by admin
I see now what your problem is. Can you please share a broader task you solving? Why do you need the two directional circuit? May be there is another solution to it? Or maybe I need to extend tri-state buffer logic to accommodate tasks like yours?

Re: Bidirectional circuit in LogicCircuit

Posted: Sun Apr 06, 2014 2:54 am
by SomeGuy
Of course there is another solution, I can just put two uni-directional wires. I can share this project (but it's unfinished and I'm certain there are errors) little later (for now I don't have access to computer that I'm working on). But I really want to use bidirectional circuit for two reasons: first, I'd really like to learn how to design such circuits, and second: I'll implement this solution later in Minecraft (I know it sounds funny but that's just my way to learn and keep it enjoyable - it will be communication network, some kind of a subway, I plan to put in on youtube when it's finished :) ) and I want to use as few materials as I can.
The circuit is the network that routes signals from source to target that has a number. Every endpoint has an interface that allows you to program target endpoint and when you do it, the signal that keeps information about target is routed throughout whole network to reach target with number it points to.
Whole network, excepting endpoints, contains comparing modules (I call them 'hubs') that are programmable using two sets of 10 buttons, 5 buttons of every set are pattern and another 5 are mask. I'll upload it here later when I have access to the project.
I'd really like to keep the single wire between hubs, a I said, to stay low on materials and learn something at the same time.

By the way - I really like the way that you care about LogicCircuit and its users, is there a way to donate you few bucks?

Re: Bidirectional circuit in LogicCircuit

Posted: Sun Apr 06, 2014 9:02 pm
by Alexander
I tried hard to understand what you need. Are you sure, what you want is "electrically possible" ? And not just a limitation of a program. As you didn't explain the entire goal, I assumed that what you need is this, but with one wire. But, at list here it is not possible. This is a two-wire solution that looks like one-wire.

Re: Bidirectional circuit in LogicCircuit

Posted: Mon Apr 07, 2014 8:22 am
by SomeGuy
Thank you for trying to figure it out :). I hope it is, as you said, "electrically possible" - I mean, I told that my knowledge about electronics is little, but it's not my design. I found it here: http://cpuville.com/three_state.htm. I can't find another source that specifies it in one single definition but I see quite a lot results in google for it - https://www.google.pl/#q=bidirectional+data+bus. And when I imagine there's no tri-state limitation in LogicalCircuit then I can't think of anything that would make it impossible. As far as I unerstand it, when one of tri-states on my schematics is in Hi-Z (disconnected) state there's just one data source connected to another one, so it shouldn't be a problem - that's what control input is for.

Your design of course solves this problem but you just simply put two wires, I know they look like one but two bits mean two wires needed and, as I said before, I really want to use single wire (my data is 5-bit wide, so 5 wires to be specific) between modules.
Thanks anyway, maybe we'll figure it out at last :).

[edit]
Okay, so... i partially figured it out. I missed little sentence in linked article that says:
The bi-directional bus allows us to connect many separate devices that have three-state outputs to the same set of wires
.
So I just prepared test harness 3 on my project, I'm reuploading it now. It's just got more complex than I could imagine - I have no idea how to construct real bidirectional circruit with receivers on both sides. Everything is explained in new circuit called "test harness 3".

Re: Bidirectional circuit in LogicCircuit

Posted: Mon Apr 07, 2014 9:12 am
by Alexander
If it is possible, try to buil it in another program. You can try this program. http://www.falstad.com/circuit/
Here you have all the low level possibilities like resistors, transistors and diodes. Then you can think how to port it.

Re: Bidirectional circuit in LogicCircuit

Posted: Mon Apr 07, 2014 9:37 am
by SomeGuy
Hi Alexander, thanks for your response. That tool looks really intimidating, I've mentioned my electronics knowledge level few times. But I'll try to handle it - I don't promise I'll do it right away (to be honest, I think that it could take few days for me to figure it out). Meanwhile, if you don't mind, I'd like you to look at updated project that I've attached to my previous post.

Re: Bidirectional circuit in LogicCircuit

Posted: Mon Apr 07, 2014 10:24 am
by Alexander
Z is not treated as 1. In Logiccircuit Z is treated like there was no pin at all. So the 3 input "And" gate with one of the inputs set to Z is treated like 2 input gate. And 2 input pins "And" gate will be like a repeater.