 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible wrote:
> However, I just found the following pages:
>
> http://www.kpsec.freeuk.com/components/ic.htm#logic
> http://www.kpsec.freeuk.com/components/74series.htm
> http://www.kpsec.freeuk.com/components/cmos.htm
>
> Suddenly everything seems so much clearer.
If you search around the Internet for long enough, you can find some
really useful stuff. For example:
http://www.play-hookey.com/digital/jk_nand_flip-flop.html
This is significantly simpler than I had imagined! ;-)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 5/25/2010 8:21 AM, Invisible wrote:
> Invisible wrote:
>
>> However, I just found the following pages:
>>
>> http://www.kpsec.freeuk.com/components/ic.htm#logic
>> http://www.kpsec.freeuk.com/components/74series.htm
>> http://www.kpsec.freeuk.com/components/cmos.htm
>>
>> Suddenly everything seems so much clearer.
>
> If you search around the Internet for long enough, you can find some
> really useful stuff. For example:
>
> http://www.play-hookey.com/digital/jk_nand_flip-flop.html
>
> This is significantly simpler than I had imagined! ;-)
It's even simpler...
All chips run off of a magic blue smoke
If you let it out, they stop working.
Just for kicks - look at the 7447 - just a bunch of logic gates.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible wrote:
> If you search around the Internet for long enough, you can find some
> really useful stuff. For example:
>
> http://www.play-hookey.com/digital/jk_nand_flip-flop.html
>
> This is significantly simpler than I had imagined! ;-)
Wow, hold on - apparently it *works* too! You can actually click on it
and watch all the gates change. Neato! I wonder how on Earth he managed
to implement that?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> Wow, hold on - apparently it *works* too! You can actually click on it
> and watch all the gates change. Neato! I wonder how on Earth he managed
> to implement that?
(Assuming FF)
View -> Page Source
Click on the link in the third script tag "jk nand flip-flop.js"
He just pre-rendered an image for each possible state by the looks of it.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
scott wrote:
> He just pre-rendered an image for each possible state by the looks of it.
Heh. And here I was thinking he did some advanced thing with DOM
rendering or something...
Hey, isn't SVG supposed to be JS-scriptable? Could you do it this way?
(By the looks of it, this website is far too old to have used that
approach - the info page talks about IE4 for example.)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible wrote:
> http://www.play-hookey.com/digital/jk_nand_flip-flop.html
>
> This is significantly simpler than I had imagined! ;-)
An RS flip-flop is not difficult to construct. I quickly discovered that
if you connect to gated RS latches together, and connect both gate pins
to the flip-flop's clock pin, but with one signal inverted, you get a
clocked flip-flop. (Gratifyingly, I discovered the website above and
found the exact same circuit design. So apparently I was right!)
Converting a gated latch or a clocked flip-flop from RS-type to D-type
is a trivial matter of adding an inverter. Making a toggle flip-flop
just requires you to take a clocked D flip-flop and connect the inverted
output back to the data input. The clock pin then becomes the toggle. So
far so good.
Now... how in the name of goodness do you add UNclocked set and reset
pins?? o_O
It's easy to make a T flip-flop, but maddeningly complicated to add
unclocked set/reset pins. I end up adding dozens and dozens and dozens
of extra gates, and the implementation is *still* as buggy as hell!
Obviously, there has to be an easier way. So I looked up the circuit
diagram for the 7474, and... oh.
I've built it in a simulator, and I can confirm that it works, but I
have utterly no clue as to *why* it works!
It's basically three RS latches, but trying to follow all the signal
paths is quite challenging. Next, they used NAND latches rather than NOR
latches. That means that the control inputs are inverted. >_< On top of
that, they used a small trick: 3-input gates. That means that each pair
of NANDs is simultaneously an RS latch *and* it performs an operation to
combine 4 inputs into two inputs (set/reset).
After expending significant time and energy confusing myself with logic
tables, I eventually figure out what, in effect, you've got a normal
(low-triggered) RS latch with a 2-input NAND gate setting on each input.
So I figured up an equivilent circuit and tried it out.
It doesn't work. It doesn't even partially work.
After about, oh, an hour maybe, I discovered the reason why: You know
how having both set and reset lines active simultaneously is an unstable
configuration for an RS latch? Well it turns out that a NAND latch with
inverted inputs is _not_ equivilent to a NOR latch; there is a single
difference between them. In the unstable configuration, a NOR latch sets
both Q and /Q to 0, while a NAND latch sets them both to 1. >_<
Not only that, but this strange flip-flop circuit seems to *depend on*
this specific behaviour. Like, one of the latches is permanently driven
in this configuration, except when certain lines are activated! Damnit!
Well anyway, I modified my circuit, and it *finally* it works correctly.
But I still don't have a clue why... Time for further study. :-/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 5/27/2010 5:48 AM, Invisible wrote:
> Invisible wrote:
>
>> http://www.play-hookey.com/digital/jk_nand_flip-flop.html
>>
>> This is significantly simpler than I had imagined! ;-)
>
> An RS flip-flop is not difficult to construct. I quickly discovered that
> if you connect to gated RS latches together, and connect both gate pins
> to the flip-flop's clock pin, but with one signal inverted, you get a
> clocked flip-flop. (Gratifyingly, I discovered the website above and
> found the exact same circuit design. So apparently I was right!)
Play-hookey is one of my favorites!
Yep, the J-K flip-flop works just like that.
> Converting a gated latch or a clocked flip-flop from RS-type to D-type
> is a trivial matter of adding an inverter. Making a toggle flip-flop
Actually, it gets better: You can make a D latch without adding the
inverter (A latch isn't clocked. The same works with a flip-flop) by
connecting one of the input gate's outputs to the other gate's input.
> just requires you to take a clocked D flip-flop and connect the inverted
> output back to the data input. The clock pin then becomes the toggle. So
> far so good.
>
> Now... how in the name of goodness do you add UNclocked set and reset
> pins?? o_O
>
Look at the "master" flip-flop. Keep in mind after the NAND gates that
are controlled by the clock, that part is a S-R latch. By adding an
extra input to those gates you can manually control the S and R signals.
You'll notice after you connect inputs to these that you can now
asynchronously control the output when the control is low.
Now, look downstream. when the clock is high, this no longer works,
you'll need to defeat the clock on this part somehow. Also note when the
clock is high, the signals from the nand gates on the first flip-flop
will need to be suppressed.
Once you've figure this out... You'll need 4 new gates to get the S-R
commands working.
--
~Mike
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike Raiford wrote:
> BTW:
>
> http://sourceforge.net/projects/logicsim/
>
> Requires .NET Framework 3.5
>
> Only really just tiny pieces of the UI implemented, but you can sort of
> see how it will work.
Hmm, interesting.
(I'm not sure what took longer - setting up a VM, installing .NET on it,
defragging it afterwards, or trying to refind this post so I could
reply! >_< )
So have you got any further with it yet? ;-)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 5/28/2010 6:41 AM, Invisible wrote:
> (I'm not sure what took longer - setting up a VM, installing .NET on it,
> defragging it afterwards, or trying to refind this post so I could
> reply! >_< )
>
> So have you got any further with it yet? ;-)
Yep.
I have the wiring completed now. I'm posting a new exe soon. I was kind
of hoping to get your opinions of the UI as I move forward.
I'm trying to keep the app as flexible as possible without being
unwieldy. The simulation core need some serious work, though.
I'm just hoping the people that download the app when it's complete
won't roast me for using the .NET framework like they did on the other
.NET app.
Also, probably due for a rename when it's more final judging by the
similarity of the name of LogiSim. I created the project before I
searched for other similar projects. That's how I found LogiSim in the
first place. Shame on me. ;)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>> So have you got any further with it yet? ;-)
>
> Yep.
>
> I have the wiring completed now. I'm posting a new exe soon. I was kind
> of hoping to get your opinions of the UI as I move forward.
You probably want to start a new thread when you do... This subthread is
fairly deeply burried. But sure, I'll look at it.
> I'm trying to keep the app as flexible as possible without being
> unwieldy. The simulation core need some serious work, though.
I could point out several things I dislike about LogiSim that I hope you
can avoid doing - but I think I'll just wait and see what you *have*
done and comment on that. ;-)
> I'm just hoping the people that download the app when it's complete
> won't roast me for using the .NET framework like they did on the other
> .NET app.
I've got a VM with .NET on it now, so it should be fairly easy to test.
> Also, probably due for a rename when it's more final judging by the
> similarity of the name of LogiSim. I created the project before I
> searched for other similar projects. That's how I found LogiSim in the
> first place. Shame on me. ;)
Well, let's see, you're writing a *logic* *simulator*. You might take a
wild guess that similar existing products will have names consisting of
some contraction of these two words... ;-)
It's like writing a Mandelbrot generator and calling it MandelPlot or
something. I wouldn't be surprised at all if somebody has already taken
that name.
Call it something random like POV-Wire or something. :-D
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |