Author Topic: Logic Gates  (Read 759 times)

0 Members and 1 Guest are viewing this topic.

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4118
  • Karma: 181
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Logic Gates
« on: June 22, 2012 »


With recent changes to the way computing is going to be taught to pupils in the UK, I've been asked to produce various resources for the new curriculum.

Here's one I've just finished - it's a logic gate simulator of sorts, including interactive inputs, truth tables and simplified CMOS circuit diagrams.

The XOR and XNOR gates were a pain in the ass, but I think they're accurate now.

(edit)

I've just noticed an error on the XOR gate when the inputs are both high - I'll fix it tonight.

(edit 2) Fixed - it should be fully accurate now.

(edit 3) Changed "Output O" to "Output Q" to avoid confusion between "0" and "O" after user feedback.

(edit 4) Changed "O" to "Q" in the truth tables too - that should fix it.
« Last Edit: June 24, 2012 by combatking0 »
You are our 9001st visitor.
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 986
  • Karma: 219
    • View Profile
    • Homepage
Re: Logic Gates
« Reply #1 on: June 22, 2012 »
That's awesome, well done!  :clap:

The output remained zero though, also when the visuals showed on.
www.kirl.nl
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4118
  • Karma: 181
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Logic Gates
« Reply #2 on: June 23, 2012 »
Oh no, which gate?
You are our 9001st visitor.
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 986
  • Karma: 219
    • View Profile
    • Homepage
Re: Logic Gates
« Reply #3 on: June 23, 2012 »
Actually I just noticed it's my mistake, sorry.  :-\

I assumed the text łnder the output node would change from 0 to 1 when it lighted up, but it's the letter O instead of a decimal. If this isn't some kind of naming convention in elctro or something meaby change it to something else?

Anyway the program looks good and the obvious similarity between electro circuits and programming logic wasn't so obvious to me when I first started programming. It was something of an enlightenment.  ^-^
www.kirl.nl
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4118
  • Karma: 181
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Logic Gates
« Reply #4 on: June 23, 2012 »
I see how that would cause confusion now - I'll see if there's a standard output letter...

...there's no official standard, but "Q" seems to have been widely adopted. Thanks for the feedback K++, I'll change it to "Q".

Hopefully something like this will be useful for beginners who are learning logic in both programming and in electronics.
You are our 9001st visitor.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1062
  • Karma: 152
    • View Profile
    • Raizor's Dev Blog
Re: Logic Gates
« Reply #5 on: June 23, 2012 »
Handy little learning app CK, nice one. K++
raizor

Challenge Trophies Won:

Offline Hotshot

  • Pentium
  • *****
  • Posts: 1814
  • Karma: 73
    • View Profile
Re: Logic Gates
« Reply #6 on: June 24, 2012 »
Good App :)

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4118
  • Karma: 181
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Logic Gates
« Reply #7 on: June 24, 2012 »
I've just noticed the Truth Tables still use "O" instead of "Q" - fixing...

I ran this program past my 8-year-old son, and he seems to understand it. Why they don't teach this sort of thing in primary schools, I'll never know.
« Last Edit: June 24, 2012 by combatking0 »
You are our 9001st visitor.
Challenge Trophies Won: