I made the original post more up-to-date. I would appreciate it if you guys could give it a read and let me know which parts need further explanation.
Rollback Post to RevisionRollBack
Support the Allocator! Find my inventions such as my pressure plate removal detector on the About Me page of my profile.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
The latter change increases the expressivity of the block such that you can directly build: Clocks, edge detectors, 2 way repeaters, latches, D/T/JK Flip-Flops,
Hi Darquan,
I'm very interested in seeing how to configure D and T flip flops.
As a MC newbie, and a novice in electronics, I couldn't tell exactly how your D FlipFlop was working in the
demo world (the 1.2 version of the mod), and the workings of the "pulse counter" (beside the 7seg display), is a total mystery to me :smile.gif:
I've been primarily using your AND / NAND / NOR gate, as I can understand those :smile.gif:
I had problems trying to configure a 3 input gate though, I'll try again, and make some notes on what's happening
This picture demonstrates how the user interface currently looks in-game. In the upper left side there is a box which specifies which sides are inputs and which ones are outputs.
Here the left, bottom (/down) and right sides are switched off. The back is an input and the top (/up) and forward sides are specified as input/output sides (i.e. both, which allows the gate to read its own output). On the right side of the interface is the generated truth table. Each output side can be configured individually which allows multiple gates to be placed in a single block. The function shown here is an edge triggered T Flip-Flop (back is the input, forward the output and up is auxiliary state used for edge detection).
How to read the truth table
Let's consider the example image above and focus on a single entry. For example, let's take state 001 on the row marked as front. Since it is on the row labeled as front, we are defining the output (on/off) of the block or wire directly in front of the block (sounds logical, right?). In the column header above you can see to which input sides the digits correspond. Here: U(p)F(ront)B(ack). So for 001 this means that when the block above the gate and the block in front of it are not powered but the block behind it is then the front output will be switched on since 001 is green. If it is red, then the output would be off.
The T Flip-Flop is a fairly complex gate (strictly speaking it's a circuit, not a gate). The basic logic gates (and, or, xor, nand, nor, xnor, implies, implied by, etc..) are easier to understand than this one.
I setup a block identical to your example, however it only works with the input (lever / redstone etc), connected
to the FRONT input (which you are referring to as an OUTPUT, which is confusing. It seems the BACK of the block
is acting as the output, even though the gui has the back marked as an input
I place the block, and looking from directly above, the "arrow" on the block is pointing to the top of the screen.
I would think that the "top of the screen / arrow" would refer to the BACK, as when the block is placed, it is in
"front" of the player ?
With Front/Back think Forward/Backward. I kinda look at it like you would with a car or WASD controls. It is the front from the camera viewpoint of the block.
Perhaps it's not entirely obvious, but the input/output configuration box shows the sides relative to the 3D rendition of the block. Draw a line between left and right, up and down and front and back and see how the axes intersect the block.
Rollback Post to RevisionRollBack
Support the Allocator! Find my inventions such as my pressure plate removal detector on the About Me page of my profile.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
I'm very interested in seeing how to configure D and T flip flops.
Hi Mike,
I'll discuss the T Flip-Flop here, since it is detailed in the first post as well. Hopefully this helps you (and others) understand it better. [edit]D Flip-Flop added below[/edit]
What complicates flip-flops is that they depend on their current output to determine the next output. A logical gate can't do this, but circuits can and since the last update so can this block. In the previous versions, I had to create a circuit which fed an output side back into an input side in order to read that previous value, in the new version this can be done with input/output sides. What complicates the block is that it is actually two circuits merged into one.
Level triggered T Flip-Flop
Here is a compact representation of the T Flip-Flop.
| T Q | Q_next |
|-----+--------|
| 0 x | x |
| 1 x | not x |
Whenever the T is off the Flip-Flop maintains its output. If T is on, then the Flip-Flop reverses its output.
The problem that arises is that if T is permanently switched on, then the output will constantly oscillate between on and off (like a clock). This is not what you want. Therefore most Flip-Flops are edge triggered instead of level triggered, i.e. they are activated when T changes from zero to one (a rising edge) and sometimes when T changes from one to zero (a falling edge).
In order to do so, an edge detector needs to be made.
Rising edge detector
An edge detector can be expressed like this:
Here I is the input and O is the output. S is a state which is read and written and expresses the concept "the input is on".
When the input is switched on, there is a short moment when S does not match I (2nd line). In this moment we enable the output O and correct S. On the third line S and I are matching again and a stable situation arises. But, O is now off!
So what can you observe?
Initially the output is off. When the input turns on, the output will turn on and immediately afterwards it will turn off. So this transforms a long on signal into a short pulse. I.e. it gives off a pulse on a rising edge.
Edge triggered T Flip-Flop
The single block T Flip-Flop merges an edge detector and a regular level-triggered T Flip-Flop into a single block to create an edge triggered T Flip-Flop. A disadvantage of truth tables is that the output is defined on ALL inputs and not just the relevant ones. These two circuits have their own inputs, but the truth table forces us to deal with all of them at the same time. Hence we have a small explosion in the number of combinations which makes the table harder to read and write.
Let's construct it based on the individual building blocks.
In the T Flip-Flop example I posted, up (U) corresponds to the state S. Front (F) corresponds to Q. Back (B) corresponds to input I. Output O would be connected to input T, but that happens internally.
Let's deal with the edge detector first. The truth table shows that S should equal I (compare I to S_next). So Up, should be set to Back (B). The image shows that exactly those combinations where B is true are marked as on (green).
Whenever O is switched on, T would switch on and Q should toggle its state. O is on whenever S and I are not equal (refer to the second table). In terms of the combined circuits this means that whenever Up (U) is off (i.e. S is off) and Back (B) is on (i.e. I is on), we change state. So in case (U,F,B) = (0,0,1) front is turned on. In case (U,F,B) = (0,1,1) then front is turned off. In all other cases Q is left unchanged, i.e. the combination is on if Front is on and off if front is off (refer to the first table and compare this with the image).
[edit] D Flip-Flop
Here is the configuration of the D FlipFlop. In terms of the wiki, the back is C (the clock), the right is D (the data) and the front is Q (the output).
If B is not active then output matches the value of F, otherwise it matches the value of D.
[/edit]
Support the Allocator! Find my inventions such as my pressure plate removal detector on the About Me page of my profile.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
I was a bit thrown off with the way the input+output sides work. This helped quite a bit.
But what is not really clear to me yet, is what happens with a block/signal on that side.
Will output always enforce the input, or can an input signal still be applied to that side somehow? (I guess not, but I have to make sure.)
The input of and input/output side is the logical OR of the previous output and the attached wiring/block.
If an input/output port is on then any block, wire, etc... on that side will receive power. If it is off then those blocks will not receive any power (at least, not from the PAL).
If the output is on then the input will be, it does not need an attached block or wire.
If the output is off but an attached block or wire is receiving power then the input is on.
Look at it like this: if there was a wire, then that wire would become powered by the output and therefore the input will be powered as well.
Another note:
I was just playing with JK Flip-Flops. The block CAN express a level triggered JK Flip-Flop without external circuitry, but for an edge triggered version it needs to have an additional torch below it to detect the edge (attach it to the side of the block with the clock input wire on it).
Support the Allocator! Find my inventions such as my pressure plate removal detector on the About Me page of my profile.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
I'm now trying to create a 4 or 8 bit register with an input enable gate attached. (i.e. input
from a data bus)
It would seem that I need to put the enable on the clock input of the d-FF, rather than the D-input,
is that correct ?
Otherwise, if I put the enable gate (just an AND gate) on the input, then when the clock changes,
the low/off output of the gate enable is changing the D-input.
I'm just trying to add the enable as simply as possible, so it's quite possible I'm not doing it
correctly :smile.gif:
I was looking at a datasheet for a 4076 register, but the FF's there have not-Q outputs, which your
D-FF doesn't seem to have ??? So I'm trying to modify the logic shown on the sheet for the enable
gates
If you require a not-Q output for the D Flip-Flop then just add one. Either attach a torch to the Q output (adds delay) or add an additional output only side (e.g. left) to the D Flip-Flop block. Configure the front output as shown in the image and invert the table for the left output (i.e. for left enable 000, 001, 010, 110).
Rollback Post to RevisionRollBack
Support the Allocator! Find my inventions such as my pressure plate removal detector on the About Me page of my profile.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
If you require a not-Q output for the D Flip-Flop then just add one. Either attach a torch to the Q output (adds delay) or add an additional output only side (e.g. left) to the D Flip-Flop block. Configure the front output as shown in the image and invert the table for the left output (i.e. for left enable 000, 001, 010, 110).
1) torch
Seems simple enough :smile.gif:
I never thought of that, but I guess besides the additional delay, there's no difference between that
"external" inverted signal, and one that would be internally generated ?
2) left output
I tried that too, and it works ..... but when "D" (right) and clock are both enabled the outputs oscillate
until one of the inputs is switched. Looks like something similar that you were describing with the T-FlipFlop ?
2) left output
I tried that too, and it works ..... but when "D" (right) and clock are both enabled the outputs oscillate
until one of the inputs is switched.
Really?
This configuration doesn't oscillate for me:
Rollback Post to RevisionRollBack
Support the Allocator! Find my inventions such as my pressure plate removal detector on the About Me page of my profile.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
From the description, it seems that this mod can tie together all of the logic gates of importance to me into one singular block.
I think I'm sold from just that, heh. I've had many a fun time jumping through unneeded hoops to get even simple stuff working. While builds that do jump through said hoops are pretty impressive, I think just rolling things together into one solid package is also really neat, heh.
Problem was I had the Left / Front settings reversed :smile.gif:
What "gate" / logic function does that give ?
I'm also confused about how edge triggered / level triggered circuits work. I've been reading stuff on the net, but I still don't get it.
Can your block be configured as either edge triggered or level triggered ?
I'm particularly interested in the D-Flop edge trigger if your gate can do it.
If so, can you post the config for edge vs leveland briefly explain what the difference is and what if any difference will be observed when using them in MC ?
Is the D-Flop you posted above, edge or level triggered ?
I've seen examples that show two D Flops connected together, to produce an edge triggered circut, so presumably ???? a "standard" D Flop is level triggered ?
Or else were they using two level triggered D Flops ?
Is there such a thing as a single edge triggered D-Flop ?
If so, would it make any sense to couple tow of them for a "better ?" edge-trig FF ?
I'm also confused about how edge triggered / level triggered circuits work. I've been reading stuff on the net, but I still don't get it.
You can draw a high/low signal over time as a graph like in this image. A level trigger activates a gate whenever it is receiving either a high or a low signal (the horizontal segments). An edge trigger activates whenever the signal changes (the vertical parts). This is either from low to high (a rising edge) or from high to low (a falling edge).
Normal gates don't depend on their previous output (i.e. for any given input there is a unique output). A circuit does not necessarily satisfy this property. It can have different outputs for the same input (take e.g. a T Flip-Flop). A level trigger will never cause problems for gates. It can remain high as long as it wants, since it's output is unique anyway. For circuits it can cause race-conditions. If you permanently power a level triggered T Flip-Flop then it's output will constantly toggle, like a clock.
Edge triggers are used to solve this. They generate a quick pulse whenever the input changes (usually only in one direction). Such that the circuit makes just a single-transition.
I'm particularly interested in the D-Flop edge trigger if your gate can do it.
In this post, I explained how to construct an edge trigger. If you want to attach an edge trigger to the D Flip-Flop, then that can be done in pretty much the same way.
The general pattern for an edge trigger is to add an input/output side for 1 bit storage. Set that side whenever the level-triggered input turns on and clear it when it turns off. Finally trigger your circuit only when the input/output side is off and the input on (not when both are not).
Unfortunately, there is insufficient space to store both the edge trigger and the negated output in a single block. So either use an external edge trigger or add a torch to Q (Front) to create not Q.
Here is an edge-triggered D Flip-Flop without not Q output.
To make a standalone edge trigger, configure a block like this:
| | UB | UB | UB | UB |
|-------+-----+----+-----+-----| Back: in
| Front | off | on | off | off | Front: out
| Up | off | on | off | on | Up: in/out
The first time Back turns on (up will be off) both up and front are activated. The next time the block updates (after the configured delay) up and back will both be on, so front is deactivated and up remains on until the back is deactivated.
Is the D-Flop you posted above, edge or level triggered ?
It is level triggered.
p.s. Is electronics your day job ?
No, I'm a software guy, a computer scientist (researcher/programmer). I've had only one course on gates/electronics during my bachelor/master studies, but I have a pretty solid base in boolean logic.
Support the Allocator! Find my inventions such as my pressure plate removal detector on the About Me page of my profile.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
The idea of a pulse, briefly activating the clock, along with having the D input set before,
the clock transition, now makes it all make sense. (I suppose the D input could be set at exactly
the same time as the clock pulse, but in practice, I would guess that setting the data before the clock
pulse is going to be easier, more reliable)
The delay / pulse circuit (NOT gates) on that page, also makes it more understandable.
Are your edge triggering blocks doing something similar to the delay circuits shown on that page ?
Are your edge triggering blocks doing something similar to the delay circuits shown on that page ?
Yes, more or less. I rely on the fact that setting an input/output side will not affect that input until the next update cycle, therefore you have a single delay long gap during which your output is high before it is lowered again.
Naturally, this redstone block does not contain nor simulate any actual circuits inside but rather performs a table lookup based on a snapshot of the current input vector.
Rollback Post to RevisionRollBack
Support the Allocator! Find my inventions such as my pressure plate removal detector on the About Me page of my profile.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
I was just trying out some stuff in a test world and build the 7-segment hexadecimal display shown below with a 4 bit adder attached. The total size is 4 wide, 5 deep and 9 high. It is a slightly smaller version of the one I already posted (the one in the demo world).
The wool colour indicates how the current is propagated. The decoder column is placed behind the 2nd wool column from the left.
7 blocks for decoding and propagating the fourth bit upwards.
3 vertical columns (7 each) for propagating the other bits upwards. Use of blocks & redstone can reduce the amount.
4 blocks for the 4 bit adder
a couple of blocks for crossing redstone wires.
some blocks for distributing the current towards the torches.
This was a test to try out the copy/pasting option that I'm adding to the gate. I.e. look at one gate, click a copy button, look at another, click paste and both the input/output and truth table configuration will be transferred to the second. The copy/paste buffers should persist across worlds but not across Minecraft sessions. I have some more ideas to work on and some more tests to perform, so a release will follow at a later stage.
Support the Allocator! Find my inventions such as my pressure plate removal detector on the About Me page of my profile.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
I'd be more interested in a save / schematic file than pictures :smile.gif:
>This was a test to try out the copy/pasting option that I'm adding to the gate.
That would be a great addition ! My current "workflow" is to run MC in a window, with Irfanview running alongside,
displaying your block settings :smile.gif:
I wish MC either had McEdit incorporated, or McEdit had client-runnability incorporated :smile.gif:
It would even help if there was a point-at-any-block-click-copy to "inventory-9-column-row" function. Or having more than 9 "active" slots available at a time.
I know that is way outside the scope /intent of your mod, I'm just rambling :wink.gif: Maybe
I'll post / look in the mod forum. I do have TMI installed, but it's still a hassle to bring up that screen, and search through the un-ordered mess of items. Placing
crafting boxes around is another kludge.
Are you using TMI ? Crafting boxes placed around ?
Or do you not run into the "9 items is not enough" that often :smile.gif:
On another note, I'm trying to figure out your "pulse" clock / counter, can you describe how it works?
And also with the that counter, it seems to get "stuck" or even broken after either multiple loads / reloads in minecraft, or possibly from the world being edited in McEdit. (Dunno for sure, I'm just guessing).
This seems to happen to even simple "native block" inverter clocks in minecraft, so I think it's a bug with the core client software.
>The wool colour indicates how the current is propagated
That's a great idea.
Have you used the wireless redstone mod? If so, any problems with it?
I've been using it along with your mod, and seemingly haven't had any problems.
Though I do have a somewhat large test circuit, where I have a counter, 7seg, and "rom" (just a bunch of
levers), all connected up with wireless, and either because I have it so spread out, or the wireless, there's
quite a delay from the counter to the display.
I don't really care if it's slow, as my intent is to build a "demo" CPU taht can be observed / walked around /inside
to see how everything works.
[WITCH IS GOOOD!]
Thanks. :smile.gif:
I made the original post more up-to-date. I would appreciate it if you guys could give it a read and let me know which parts need further explanation.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
Hi Darquan,
I'm very interested in seeing how to configure D and T flip flops.
As a MC newbie, and a novice in electronics, I couldn't tell exactly how your D FlipFlop was working in the
demo world (the 1.2 version of the mod), and the workings of the "pulse counter" (beside the 7seg display), is a total mystery to me :smile.gif:
I've been primarily using your AND / NAND / NOR gate, as I can understand those :smile.gif:
I had problems trying to configure a 3 input gate though, I'll try again, and make some notes on what's happening
Mike
I setup a block identical to your example, however it only works with the input (lever / redstone etc), connected
to the FRONT input (which you are referring to as an OUTPUT, which is confusing. It seems the BACK of the block
is acting as the output, even though the gui has the back marked as an input
Mike
what I thought they were :wink.gif:
I place the block, and looking from directly above, the "arrow" on the block is pointing to the top of the screen.
I would think that the "top of the screen / arrow" would refer to the BACK, as when the block is placed, it is in
"front" of the player ?
Mike
With Front/Back think Forward/Backward. I kinda look at it like you would with a car or WASD controls. It is the front from the camera viewpoint of the block.
Perhaps it's not entirely obvious, but the input/output configuration box shows the sides relative to the 3D rendition of the block. Draw a line between left and right, up and down and front and back and see how the axes intersect the block.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
Hi Mike,
I'll discuss the T Flip-Flop here, since it is detailed in the first post as well. Hopefully this helps you (and others) understand it better. [edit]D Flip-Flop added below[/edit]
What complicates flip-flops is that they depend on their current output to determine the next output. A logical gate can't do this, but circuits can and since the last update so can this block. In the previous versions, I had to create a circuit which fed an output side back into an input side in order to read that previous value, in the new version this can be done with input/output sides. What complicates the block is that it is actually two circuits merged into one.
Level triggered T Flip-Flop
Here is a compact representation of the T Flip-Flop.
Whenever the T is off the Flip-Flop maintains its output. If T is on, then the Flip-Flop reverses its output.
The problem that arises is that if T is permanently switched on, then the output will constantly oscillate between on and off (like a clock). This is not what you want. Therefore most Flip-Flops are edge triggered instead of level triggered, i.e. they are activated when T changes from zero to one (a rising edge) and sometimes when T changes from one to zero (a falling edge).
In order to do so, an edge detector needs to be made.
Rising edge detector
An edge detector can be expressed like this:
Here I is the input and O is the output. S is a state which is read and written and expresses the concept "the input is on".
When the input is switched on, there is a short moment when S does not match I (2nd line). In this moment we enable the output O and correct S. On the third line S and I are matching again and a stable situation arises. But, O is now off!
So what can you observe?
Initially the output is off. When the input turns on, the output will turn on and immediately afterwards it will turn off. So this transforms a long on signal into a short pulse. I.e. it gives off a pulse on a rising edge.
Edge triggered T Flip-Flop
The single block T Flip-Flop merges an edge detector and a regular level-triggered T Flip-Flop into a single block to create an edge triggered T Flip-Flop. A disadvantage of truth tables is that the output is defined on ALL inputs and not just the relevant ones. These two circuits have their own inputs, but the truth table forces us to deal with all of them at the same time. Hence we have a small explosion in the number of combinations which makes the table harder to read and write.
Let's construct it based on the individual building blocks.
In the T Flip-Flop example I posted, up (U) corresponds to the state S. Front (F) corresponds to Q. Back (B) corresponds to input I. Output O would be connected to input T, but that happens internally.
Let's deal with the edge detector first. The truth table shows that S should equal I (compare I to S_next). So Up, should be set to Back (B). The image shows that exactly those combinations where B is true are marked as on (green).
Whenever O is switched on, T would switch on and Q should toggle its state. O is on whenever S and I are not equal (refer to the second table). In terms of the combined circuits this means that whenever Up (U) is off (i.e. S is off) and Back (B) is on (i.e. I is on), we change state. So in case (U,F,B) = (0,0,1) front is turned on. In case (U,F,B) = (0,1,1) then front is turned off. In all other cases Q is left unchanged, i.e. the combination is on if Front is on and off if front is off (refer to the first table and compare this with the image).
[edit]
D Flip-Flop
Here is the configuration of the D FlipFlop. In terms of the wiki, the back is C (the clock), the right is D (the data) and the front is Q (the output).
If B is not active then output matches the value of F, otherwise it matches the value of D.
[/edit]
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
The input of and input/output side is the logical OR of the previous output and the attached wiring/block.
Another note:
I was just playing with JK Flip-Flops. The block CAN express a level triggered JK Flip-Flop without external circuitry, but for an edge triggered version it needs to have an additional torch below it to detect the edge (attach it to the side of the block with the clock input wire on it).
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
Thanks for all that great info !
I'm now trying to create a 4 or 8 bit register with an input enable gate attached. (i.e. input
from a data bus)
It would seem that I need to put the enable on the clock input of the d-FF, rather than the D-input,
is that correct ?
Otherwise, if I put the enable gate (just an AND gate) on the input, then when the clock changes,
the low/off output of the gate enable is changing the D-input.
I'm just trying to add the enable as simply as possible, so it's quite possible I'm not doing it
correctly :smile.gif:
I was looking at a datasheet for a 4076 register, but the FF's there have not-Q outputs, which your
D-FF doesn't seem to have ??? So I'm trying to modify the logic shown on the sheet for the enable
gates
Mike
http://mstram.webfactional.com/webb/4076-1.jpg
http://mstram.webfactional.com/webb/4076-2.jpg
If you require a not-Q output for the D Flip-Flop then just add one. Either attach a torch to the Q output (adds delay) or add an additional output only side (e.g. left) to the D Flip-Flop block. Configure the front output as shown in the image and invert the table for the left output (i.e. for left enable 000, 001, 010, 110).
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
1) torch
Seems simple enough :smile.gif:
I never thought of that, but I guess besides the additional delay, there's no difference between that
"external" inverted signal, and one that would be internally generated ?
2) left output
I tried that too, and it works ..... but when "D" (right) and clock are both enabled the outputs oscillate
until one of the inputs is switched. Looks like something similar that you were describing with the T-FlipFlop ?
Mike
Really?
This configuration doesn't oscillate for me:
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
I think I'm sold from just that, heh. I've had many a fun time jumping through unneeded hoops to get even simple stuff working. While builds that do jump through said hoops are pretty impressive, I think just rolling things together into one solid package is also really neat, heh.
"sometimes, wizards are so awesome, it hurts"
Ya that works fine for me too.
Problem was I had the Left / Front settings reversed :smile.gif:
What "gate" / logic function does that give ?
I'm also confused about how edge triggered / level triggered circuits work. I've been reading stuff on the net, but I still don't get it.
Can your block be configured as either edge triggered or level triggered ?
I'm particularly interested in the D-Flop edge trigger if your gate can do it.
If so, can you post the config for edge vs leveland briefly explain what the difference is and what if any difference will be observed when using them in MC ?
Is the D-Flop you posted above, edge or level triggered ?
I've seen examples that show two D Flops connected together, to produce an edge triggered circut, so presumably ???? a "standard" D Flop is level triggered ?
Or else were they using two level triggered D Flops ?
Is there such a thing as a single edge triggered D-Flop ?
If so, would it make any sense to couple tow of them for a "better ?" edge-trig FF ?
thx
Mike
p.s. Is electronics your day job ?
It's not a "gate", it's a D Flip-Flop circuit. That's what you requested, right? Front outputs Q and left outputs not Q.
You can draw a high/low signal over time as a graph like in this image. A level trigger activates a gate whenever it is receiving either a high or a low signal (the horizontal segments). An edge trigger activates whenever the signal changes (the vertical parts). This is either from low to high (a rising edge) or from high to low (a falling edge).
Normal gates don't depend on their previous output (i.e. for any given input there is a unique output). A circuit does not necessarily satisfy this property. It can have different outputs for the same input (take e.g. a T Flip-Flop). A level trigger will never cause problems for gates. It can remain high as long as it wants, since it's output is unique anyway. For circuits it can cause race-conditions. If you permanently power a level triggered T Flip-Flop then it's output will constantly toggle, like a clock.
Edge triggers are used to solve this. They generate a quick pulse whenever the input changes (usually only in one direction). Such that the circuit makes just a single-transition.
In this post, I explained how to construct an edge trigger. If you want to attach an edge trigger to the D Flip-Flop, then that can be done in pretty much the same way.
The general pattern for an edge trigger is to add an input/output side for 1 bit storage. Set that side whenever the level-triggered input turns on and clear it when it turns off. Finally trigger your circuit only when the input/output side is off and the input on (not when both are not).
Unfortunately, there is insufficient space to store both the edge trigger and the negated output in a single block. So either use an external edge trigger or add a torch to Q (Front) to create not Q.
Here is an edge-triggered D Flip-Flop without not Q output.
To make a standalone edge trigger, configure a block like this:
The first time Back turns on (up will be off) both up and front are activated. The next time the block updates (after the configured delay) up and back will both be on, so front is deactivated and up remains on until the back is deactivated.
It is level triggered.
No, I'm a software guy, a computer scientist (researcher/programmer). I've had only one course on gates/electronics during my bachelor/master studies, but I have a pretty solid base in boolean logic.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
Thanks for that explanation !
I found some further info here :
http://www.allaboutcircuits.com/vol_4/chpt_10/5.html
The idea of a pulse, briefly activating the clock, along with having the D input set before,
the clock transition, now makes it all make sense. (I suppose the D input could be set at exactly
the same time as the clock pulse, but in practice, I would guess that setting the data before the clock
pulse is going to be easier, more reliable)
The delay / pulse circuit (NOT gates) on that page, also makes it more understandable.
Are your edge triggering blocks doing something similar to the delay circuits shown on that page ?
Mike
Yes, more or less. I rely on the fact that setting an input/output side will not affect that input until the next update cycle, therefore you have a single delay long gap during which your output is high before it is lowered again.
Naturally, this redstone block does not contain nor simulate any actual circuits inside but rather performs a table lookup based on a snapshot of the current input vector.
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
[edit]Reduced the size a bit.[/edit]
I'm still looking for more feedback on my configurable Redstone Gate mod. All gates and common circuits (such as e.g. clocks, edge detectors, latches and Flip-Flops) in a single block.
>This was a test to try out the copy/pasting option that I'm adding to the gate.
That would be a great addition ! My current "workflow" is to run MC in a window, with Irfanview running alongside,
displaying your block settings :smile.gif:
I wish MC either had McEdit incorporated, or McEdit had client-runnability incorporated :smile.gif:
It would even help if there was a point-at-any-block-click-copy to "inventory-9-column-row" function. Or having more than 9 "active" slots available at a time.
I know that is way outside the scope /intent of your mod, I'm just rambling :wink.gif: Maybe
I'll post / look in the mod forum. I do have TMI installed, but it's still a hassle to bring up that screen, and search through the un-ordered mess of items. Placing
crafting boxes around is another kludge.
Are you using TMI ? Crafting boxes placed around ?
Or do you not run into the "9 items is not enough" that often :smile.gif:
On another note, I'm trying to figure out your "pulse" clock / counter, can you describe how it works?
And also with the that counter, it seems to get "stuck" or even broken after either multiple loads / reloads in minecraft, or possibly from the world being edited in McEdit. (Dunno for sure, I'm just guessing).
This seems to happen to even simple "native block" inverter clocks in minecraft, so I think it's a bug with the core client software.
Mike
That's a great idea.
Have you used the wireless redstone mod? If so, any problems with it?
I've been using it along with your mod, and seemingly haven't had any problems.
Though I do have a somewhat large test circuit, where I have a counter, 7seg, and "rom" (just a bunch of
levers), all connected up with wireless, and either because I have it so spread out, or the wireless, there's
quite a delay from the counter to the display.
I don't really care if it's slow, as my intent is to build a "demo" CPU taht can be observed / walked around /inside
to see how everything works.
Mike