Author Topic: Anyone use Logisim?  (Read 53223 times)

0 Members and 1 Guest are viewing this topic.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Anyone use Logisim?
« Reply #15 on: December 01, 2010, 07:25:10 pm »
Very nice. I'll try this right away!

EDIT: This is incredible!
« Last Edit: December 01, 2010, 07:30:10 pm by graphmastur »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Anyone use Logisim?
« Reply #16 on: December 01, 2010, 07:27:06 pm »
Note that you have to compile the code yourself into hex using the binary table :P registers are 00 for A, 01 for B 10 for C and 11 for D.  And for jumps 00 is jump if Zero, 01 is jump if carry, 10 is jump if Not Zero, and 11 is jump if not carry

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Anyone use Logisim?
« Reply #17 on: December 01, 2010, 07:31:02 pm »
Note that you have to compile the code yourself into hex using the binary table :P registers are 00 for A, 01 for B 10 for C and 11 for D.  And for jumps 00 is jump if Zero, 01 is jump if carry, 10 is jump if Not Zero, and 11 is jump if not carry
When I was making one, I only used 4 registers too. I tried figuring out how to change the registers too.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Anyone use Logisim?
« Reply #18 on: December 01, 2010, 07:38:26 pm »
Yeah, and plus with my cpu every instruction takes 8 clock cycles no matter what (even the 2 byte ones) so there is no speed increase gained by using registers.  Buuut they are the only way to do math and stuff :P

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Anyone use Logisim?
« Reply #19 on: December 01, 2010, 07:48:09 pm »
Well, I've spent the last two days making a cpu. I must say it is pretty interesting. I have managed to get 5 registers and the commands nop; ld register, imm; jp imm; ld (imm), a; and ld a, (imm). But I have been halted by what I believe to be a glitch in the program.

My PC is set to latch input on the falling edge of the clock. But now and then, it latches on the rising edge! This makes my program fail pretty bad because there is no usable data on the rising edge. My program just loops back to 0000.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Anyone use Logisim?
« Reply #20 on: December 01, 2010, 07:50:19 pm »
Hurmm that sounds weird, could you post a file and we could all take a look at it?

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Anyone use Logisim?
« Reply #21 on: December 01, 2010, 07:55:45 pm »
This might scare the crap out of you, but here it is. The whole cpu is on one screen.

Important stuff:
All commands take 4 clocks.

00 nop
01 ld a, imm
02 ld b, imm
03 ld c, imm
04 ld d, imm
05 jp imm
06 ld (imm), a
07 ld a, (imm)

The program I have loaded is this.
Code: [Select]
ld a, $69
ld ($0102), a
ld a, $FF
ld a, ($0102)
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Anyone use Logisim?
« Reply #22 on: December 01, 2010, 07:57:29 pm »
I don't think he gave the file.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Anyone use Logisim?
« Reply #23 on: December 01, 2010, 08:04:29 pm »
You would be correct. Just take off the .txt extension.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Anyone use Logisim?
« Reply #24 on: December 01, 2010, 08:17:40 pm »
Ah, found the issue, and its not logisim.  Try attaching a regular counter onto the same clock as PC is attached to.  When the 'glitch' occurs, the counter increments twice.  This tells me there is some logical errors in your cpu that is causing the clock to quickly go from down, to up, back to down, then back up again.

EDIT: I have narrowed down the error further, it seems to be coming from the pin 6th from the right from the phase 1 box.  Also, you might want to look into multiplexers, as they do exactly what your bit selectors do
« Last Edit: December 01, 2010, 08:26:31 pm by Builderboy »

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Anyone use Logisim?
« Reply #25 on: December 01, 2010, 08:42:06 pm »
Yay, I fixed it. The current instruction register was outputting a 6 just before it got changed to 1. So I just bypassed it for phase 1 and it worked. Off to make a text routine.

Thank you
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Anyone use Logisim?
« Reply #26 on: December 01, 2010, 08:51:49 pm »
Oh my wow. Screw programming in hex, I am already loving this. Thank you, I am going to have so much fun with this.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Anyone use Logisim?
« Reply #27 on: December 01, 2010, 08:58:08 pm »
Yay, I fixed it. The current instruction register was outputting a 6 just before it got changed to 1. So I just bypassed it for phase 1 and it worked. Off to make a text routine.

Thank you

No problem :) Did you check out multiplexers and demultiplexers?  I think they could greatly speed up and simplify your code :)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Anyone use Logisim?
« Reply #28 on: December 01, 2010, 09:01:14 pm »
Oh my wow. Screw programming in hex, I am already loving this. Thank you, I am going to have so much fun with this.

Next thing we know, you'll be presenting a hardware mod that lets you flip gates in the z80 :P
« Last Edit: December 01, 2010, 09:01:40 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Anyone use Logisim?
« Reply #29 on: December 01, 2010, 09:01:15 pm »
What is the logic called where if both bits are the same, the output bit is 1. Isn't XOR 1 if the inputs are different?