Logic Gates (Without Combinators!)
Logic Gates (Without Combinators!)
Logic Gates designs and 1st step to do something bigger. I'm using side inserters mod for more compact and faster design
-----------------------------------------------------------
Legend:
Green arrow - smart inserter
Blue arrow - fast inserter
P - Pole
WC - Wooden Chest
SC - Smart Chest
R - red circuit (R=1 mean 1 item in red circuit)
G - green circuit
-----------------------------------------------------------
A B | AND
0 0 | 0
0 1 | 0
1 0 | 0
1 1 | 1
A B | OR
0 0 | 0
0 1 | 1
1 0 | 1
1 1 | 1
A B | XOR
0 0 | 0
0 1 | 1
1 0 | 1
1 1 | 0
It's compact design, and output is TRUE when 2 items are in logistic system (1 item in each smart chest).
To set that 1 item is true, you can add buffer that will more item into Smart chest when Oputput =2 and remove it when Output < 2
A | NOT
0 | 1
1 | 0
A B | NAND
0 0 | 1
0 1 | 1
1 0 | 1
1 1 | 0
A B | NOR
0 0 | 1
0 1 | 0
1 0 | 0
1 1 | 0
A B | XNOR
0 0 | 1
0 1 | 0
1 0 | 0
1 1 | 1
It's compact design, and output is TRUE when 2 items are in logistic system (1 item in each smart chest).
To set that 1 item is true, you can add buffer that will more item into Smart chest when Oputput =2 and remove it when Output < 2
Ingame gated
T Flip-Flop
http://i.gyazo.com/669f2213093b645d5852359ff060b71b.mp4
On left you can see timer. Each time when item reach SmartChest it change logic state on output (lamps are turning on and off). It can be used as memory cell in more complex designs.
First design of Seven-segment display. Wires connections are ugly but after some tests l will make them prettier.
-----------------------------------------------------------
Legend:
Green arrow - smart inserter
Blue arrow - fast inserter
P - Pole
WC - Wooden Chest
SC - Smart Chest
R - red circuit (R=1 mean 1 item in red circuit)
G - green circuit
-----------------------------------------------------------
A B | AND
0 0 | 0
0 1 | 0
1 0 | 0
1 1 | 1
A B | OR
0 0 | 0
0 1 | 1
1 0 | 1
1 1 | 1
A B | XOR
0 0 | 0
0 1 | 1
1 0 | 1
1 1 | 0
It's compact design, and output is TRUE when 2 items are in logistic system (1 item in each smart chest).
To set that 1 item is true, you can add buffer that will more item into Smart chest when Oputput =2 and remove it when Output < 2
A | NOT
0 | 1
1 | 0
A B | NAND
0 0 | 1
0 1 | 1
1 0 | 1
1 1 | 0
A B | NOR
0 0 | 1
0 1 | 0
1 0 | 0
1 1 | 0
A B | XNOR
0 0 | 1
0 1 | 0
1 0 | 0
1 1 | 1
It's compact design, and output is TRUE when 2 items are in logistic system (1 item in each smart chest).
To set that 1 item is true, you can add buffer that will more item into Smart chest when Oputput =2 and remove it when Output < 2
Ingame gated
T Flip-Flop
http://i.gyazo.com/669f2213093b645d5852359ff060b71b.mp4
On left you can see timer. Each time when item reach SmartChest it change logic state on output (lamps are turning on and off). It can be used as memory cell in more complex designs.
First design of Seven-segment display. Wires connections are ugly but after some tests l will make them prettier.
Last edited by ssilk on Mon Sep 19, 2016 10:35 pm, edited 3 times in total.
Reason: changed topic to fit subject better
Reason: changed topic to fit subject better
Re: Logic Gates
Ok, so explain it like i'm 5... What are you aiming to achieve here?
Re: Logic Gates
I'm doing it just for fun because after over 500h in game, building next factory became boring.
Right now I want to build "clock". It won't show actual time but I want to build something what is not mainstream in the game.
Next it will be day counter
Maybe after that I will build more complex circuits like calculator or something.
Right now I want to build "clock". It won't show actual time but I want to build something what is not mainstream in the game.
Next it will be day counter
Maybe after that I will build more complex circuits like calculator or something.
Re: Logic Gates
Oh man, this is how it starts you know... soon you will be implementing a full fledged computer in the game. What will you use for memory? Will you design latches? or are you going to use the presence/absence of items in boxes or something like that?
Edit: Woops sorry, I noticed that you mentioned memory in your post.
Edit: Woops sorry, I noticed that you mentioned memory in your post.
Re: Logic Gates
Just finished, 4bit synchronous counter
I have to build logic for display and to skip counting after 9 and set again on 0.
I have to build logic for display and to skip counting after 9 and set again on 0.
Re: Logic Gates
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Logic Gates
A clock like this?Neotix wrote:I'm doing it just for fun because after over 500h in game, building next factory became boring.
Right now I want to build "clock". It won't show actual time but I want to build something what is not mainstream in the game.
Next it will be day counter
Maybe after that I will build more complex circuits like calculator or something.
A calculator or something would be really cool
Re: Logic Gates
I was considering doing an in-game computer. I worked out an efficient way to deal with multi-bit values (storage, bitwise ops, and math ops) as well as how to do a "speedy" (to the extent the game allows) multi-port register file. But each piece of such a computer requires extensive configuration with respect to placing the right number and type of items (wood, coal, iron plate, etc.) in the right place, and currently blueprints do not capture that information so construction robots won't place the items for you, making such a construction on the scale needed to do a computer a lot more work than I am willing to do (and hopelessly error prone). Another option is to design the system to be "self booting" so to speak -- have extra parts whose sole purpose is to move items from mass/uniform storage to where they need to be such that you achieve some valid initial state, but this adds so much crap to the design (such reset pieces end up being the vast majority of the build) that it's just depressing to think about how space- and part-inefficient the final result is, plus it's a lot more design work. (I also have ideas for packet-based communication and packet-based routing of raw materials both by belt and train, making it possible for the computer to truly control a massive base, but they suffer from the same issues.) That just leaves making it via some Lua scripting, but that really seems like cheating.luhem7 wrote:Oh man, this is how it starts you know... soon you will be implementing a full fledged computer in the game.
It's kind of sad, because I was hoping to build my first multi-GW computer (maybe the first multi-GW computer in human history!).
Re: Logic Gates
I'm energeticist, not electronics so my knowledge about electronic designs is very limited. All I build in Factorio is based on simple knowledge and of course trials and fails. For me it's all fun in that to try something new, being creative event in ridiculous things
I don't think so that I'm able to build something such complex like computer just trying and without specialist knowledge.
Right now I want to build clock and day counter with digits display.
One problem that I had to face while building clock was that constant signal cause continuous states changes. To deal with it I had to build buffer that will send impulse signal. So now whet buffer detect signal (continuous or impulse) from Red wire it will send impulse. With that nest latch will change state once. Additional buffer can be locket by signal from green wire and it will help me to build setting system that will skip counting after 9 and set 0.
I don't think so that I'm able to build something such complex like computer just trying and without specialist knowledge.
Right now I want to build clock and day counter with digits display.
One problem that I had to face while building clock was that constant signal cause continuous states changes. To deal with it I had to build buffer that will send impulse signal. So now whet buffer detect signal (continuous or impulse) from Red wire it will send impulse. With that nest latch will change state once. Additional buffer can be locket by signal from green wire and it will help me to build setting system that will skip counting after 9 and set 0.
Re: Logic Gates
Fully operating Seven-segment display
It will show how many items are in smart chest (from 0 to 9).
Connecting multiple displays with proper configuration in smart switches, it can show how many items are in storage
I used lamps but they're problematic. Now I'm using inserters and "no power icon" If i want to display "1", smart switches provide electricity to segments ADEFG and segments BC have no power.
It will show how many items are in smart chest (from 0 to 9).
Connecting multiple displays with proper configuration in smart switches, it can show how many items are in storage
I used lamps but they're problematic. Now I'm using inserters and "no power icon" If i want to display "1", smart switches provide electricity to segments ADEFG and segments BC have no power.
Re: Logic Gates
Maybe you could use the blue logistics chest.NotABiter wrote:I was considering doing an in-game computer. I worked out an efficient way to deal with multi-bit values (storage, bitwise ops, and math ops) as well as how to do a "speedy" (to the extent the game allows) multi-port register file. But each piece of such a computer requires extensive configuration with respect to placing the right number and type of items (wood, coal, iron plate, etc.) in the right place, and currently blueprints do not capture that information so construction robots won't place the items for you, making such a construction on the scale needed to do a computer a lot more work than I am willing to do (and hopelessly error prone). Another option is to design the system to be "self booting" so to speak -- have extra parts whose sole purpose is to move items from mass/uniform storage to where they need to be such that you achieve some valid initial state, but this adds so much crap to the design (such reset pieces end up being the vast majority of the build) that it's just depressing to think about how space- and part-inefficient the final result is, plus it's a lot more design work. (I also have ideas for packet-based communication and packet-based routing of raw materials both by belt and train, making it possible for the computer to truly control a massive base, but they suffer from the same issues.) That just leaves making it via some Lua scripting, but that really seems like cheating.luhem7 wrote:Oh man, this is how it starts you know... soon you will be implementing a full fledged computer in the game.
It's kind of sad, because I was hoping to build my first multi-GW computer (maybe the first multi-GW computer in human history!).
Just build the whole system disconected from the power network, give the robots the items from a red chest, remove the red chest and conect the power.
Re: Logic Gates
Let me smash your dream even further, factorio is an very precise game exept that inserters ( And many more things ) will not go at the same speed if placed in another chunk, so building any sort of time tracking device will not ensure your entire computer is in sync with other parts which means you would have to be smart about your component placement especially when you try to compare things ( Like most logic gates do )NotABiter wrote:I was considering doing an in-game computer. I worked out an efficient way to deal with multi-bit values (storage, bitwise ops, and math ops) as well as how to do a "speedy" (to the extent the game allows) multi-port register file. But each piece of such a computer requires extensive configuration with respect to placing the right number and type of items (wood, coal, iron plate, etc.) in the right place, and currently blueprints do not capture that information so construction robots won't place the items for you, making such a construction on the scale needed to do a computer a lot more work than I am willing to do (and hopelessly error prone). Another option is to design the system to be "self booting" so to speak -- have extra parts whose sole purpose is to move items from mass/uniform storage to where they need to be such that you achieve some valid initial state, but this adds so much crap to the design (such reset pieces end up being the vast majority of the build) that it's just depressing to think about how space- and part-inefficient the final result is, plus it's a lot more design work. (I also have ideas for packet-based communication and packet-based routing of raw materials both by belt and train, making it possible for the computer to truly control a massive base, but they suffer from the same issues.) That just leaves making it via some Lua scripting, but that really seems like cheating.luhem7 wrote:Oh man, this is how it starts you know... soon you will be implementing a full fledged computer in the game.
It's kind of sad, because I was hoping to build my first multi-GW computer (maybe the first multi-GW computer in human history!).
Re: Logic Gates
Inserters are as precise as everything else, the problem is that actions of entities in the game are not simultaneous and the order of the actions is not easily predicted (but it is completely deterministic).
For example two inserters taking from a single chest that is filled by a third inserter is problematic, because the situation might end up that one inserter takes, everything, the other takes everything, or something in between, depending on the order of building them and partially also on position in the world.
IMHO belts would be better for timing of logic gates, with inserters only having a single long window to take items (fast inserter taking from almost empty belt is easily predictable and no problem at all).
For example two inserters taking from a single chest that is filled by a third inserter is problematic, because the situation might end up that one inserter takes, everything, the other takes everything, or something in between, depending on the order of building them and partially also on position in the world.
IMHO belts would be better for timing of logic gates, with inserters only having a single long window to take items (fast inserter taking from almost empty belt is easily predictable and no problem at all).
Re: Logic Gates
This is awesome. I especially like Neotix' seven segment display. There should be a LED object for this kind of stuff. Maybe even with configurable color.
With this you could create a calculator that actually displays the result... I don't know if I could do that, but I'm sure someone eventually will.
With this you could create a calculator that actually displays the result... I don't know if I could do that, but I'm sure someone eventually will.
-
- Filter Inserter
- Posts: 310
- Joined: Fri Nov 07, 2014 3:46 am
- Contact:
Re: Logic Gates
planned for 0.12.something
Re: Logic Gates
That might just work. Thanks for the idea. I haven't been playing Factorio recently, but when I get back to it I'll see if that can be made to work in my designs.Ironmarck wrote:Maybe you could use the blue logistics chest.
Do you have more details on the nature of these chunk-to-chunk differences?Yttrium wrote:Let me smash your dream even further, factorio is an very precise game exept that inserters ( And many more things ) will not go at the same speed if placed in another chunk, so building any sort of time tracking device will not ensure your entire computer is in sync with other parts which means you would have to be smart about your component placement especially when you try to compare things ( Like most logic gates do )
These differences would mean that even a fairly small bit of logic that normally works could fail if it just happened to be on a chunk boundary? (If so, that doesn't seem very nice.)
BTW, my designs don't currently rely on time tracking, but rather make use of a clock signal - but speed differences would still break that (i.e., if the clock generator is running too fast for other elements to keep up -- though as long as there is some limit on the slowness it should be fixable by artificially slowing down the clock generator).
You now have me worried about how red/green wire networks that cross multiple chunk boundaries might (mis)behave. (E.g., if there's a chance that signal propagation might experience single-game-tick delays at chunk boundaries. Though my current guess is that signal wires do not have a direction of propagation and are actually processed as monolithic entities by the game, so they're free of any "clock skew".) I'll have to do some tests when I get some time.
...otherwise known as a "race condition". I have enough experience in multi-threading, multi-processing and hardware design to not make a mistake quite as obvious as the one you describe. (Though there may be other pitfalls in "factorio logic" that I don't know about, such as the chunk issue Yttrium mentioned.)cube wrote:For example two inserters taking from a single chest that is filled by a third inserter is problematic
I would be happy with being able to turn lights on and off at will (via red/green wire signals), even during the day. (Even ignoring using lights for computers, it's just annoying to have a nice bright factory... and then suddenly it gets real dark because, you know, the sun has started coming up. I'd rather burn the juice and run the lights all day than deal with that.)Bleda wrote:There should be a LED object for this kind of stuff. Maybe even with configurable color.
Configurable color sounds cool though. Especially if that is dynamic (somehow based on red/green wire signals) so I could make an in game computer with a "full color" (4 or 8 colors) dot matrix display.
Re: Logic Gates
Whoa!LordFedora wrote:planned for 0.12.something
Re: Logic Gates
Amazing!Neotix wrote:Fully operating Seven-segment display
It will show how many items are in smart chest (from 0 to 9).
Connecting multiple displays with proper configuration in smart switches, it can show how many items are in storage
I used lamps but they're problematic. Now I'm using inserters and "no power icon" If i want to display "1", smart switches provide electricity to segments ADEFG and segments BC have no power.
Requires the Smart Circuit Systems mod (https://forums.factorio.com/forum/vie ... =14&t=6272)
I'm guessing this is what's being added to 0.12?