Source for Oscillation errors

If you have something to say about LogicCircuit program or you know how to improve it please share it here.
Post Reply
dark32
Posts: 4
Joined: Mon May 18, 2015 12:57 am

Source for Oscillation errors

Post by dark32 »

Hey Forum,
First of all, I am new to electronics. I've designed a computer and while debugging it I ran into an oscillation error :o . I couldn't find the source (the project is huge) of the error and that is very irritating :x . Thus, I wanted feature that could tell what is the source of the error. It should at least specify in which circuit it has took place. I know how much it takes to edit the code than write code because I am a programmer myself. Anyway, if there is some other way to find out the source of the error then please tell me. Thanks in advance :) .
User avatar
admin
Site Admin
Posts: 406
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: Source for Oscillation errors

Post by admin »

When you building a huge project it is usually good idea to test different components separately, before trying them out together.
If this testing will not reveal the source of problem you can share your circuit here, so I or someone else will give it a try.
dark32
Posts: 4
Joined: Mon May 18, 2015 12:57 am

Re: Source for Oscillation errors

Post by dark32 »

Thanks for replying admin, I've tested most of the circuits individually and found another problem, the RAM doesn't write. I think it must be because of the fact that it writes on the rising edge of the clock while all my other components write when the clock is high. Oscillation error still occurs, I've included the logic circuit
Computer.CircuitProject
The Computer
(633.68 KiB) Downloaded 641 times
and you have to do the following for the error:
1. Set RAM values as:
Address Value
000 Random(not zero)
001 Random(not zero)
002 Random(not zero)
100 01
101 12
102 2E
2. Press the RSET button
3. Keeping turning the CLK button on and off

It will throw an oscillation error after about 40 clicks.
I am new to electronics and still in high school, as they don't happen to give electronics courses so I learn by myself.
Also, it would also be great if you can help with the RAM. I want it to write when clock is high instead of it rising from 0 to 1. I think that is what most RAM chips do.
Almost forgot to say, you've made a great piece of code! Keep up the good work Eugene.
User avatar
admin
Site Admin
Posts: 406
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: Source for Oscillation errors

Post by admin »

I have looked at your computer. It is quite complicated and will take a lot of time for to figure out where the problem is. For you it will be much faster as only you know all the idea behind your design. I still think you need to build a few test circuits and check how all the parts work before you can find what is wrong with main circuit. Another suggestion is to try making simpler circuits it is very hard to follow logic in the web of wires. If you break it to smaller pieces, it will be easier to understand and debug. I am usually trying to keep circuit entirely visible on the screen in 100% zoom. For that matter it helpful to bundle wires. For example in your ALU instead of having A1-A8 you just have one pin A of 8 bit wide. To see some examples you can download sample circuits. There is a 16 bits computer there so you can see how to minimize your design.
As for your suggestion to point to where the oscillation occurred it is usually impossible to do as the oscillation can float around and so there is no any single point of failure.
dark32
Posts: 4
Joined: Mon May 18, 2015 12:57 am

Re: Source for Oscillation errors

Post by dark32 »

Hello again,
Thanks for replying admin.
The oscillation error disappeared by adding a register in the RAM input pin for reasons I don't know. But I encountered another error in the machine. I think it is more related to the software. One of the flip-flops of the program counter flips without the clock input. I've tried and tested them with probes.
You might want to see what is happening in the circuit yourself. This error only occurs when you set the ram address 100(10 row; 0 column) to 07. Push the reset button then keep clicking the clock button 12 times. As said earlier, the flip-flop flips without clock input. You can trace back the input from the program counter to the control matrix (to the Ce output). You'll shall see a 6 input AND gate which might be causing the problem. I've attached probes:
CLK is the clock input of the flip flop
Q is the output of the flip-flop
C6 is the input of the control matrix, when it goes high the flip-flop also goes high.
JKin the are the J-K input of the flip flop which are connected.
The circuit is a bit complicated, but it is my first circuit in this program. If you have any question regarding it please be free to PM me. I'll try to reply as soon as I can.

~Thanks,
dark32
Attachments
Computer.CircuitProject
The new circuit with oscilation fix and probes
(733.34 KiB) Downloaded 556 times
User avatar
admin
Site Admin
Posts: 406
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: Source for Oscillation errors

Post by admin »

I guess the problem with your flip-flops is they are clocked by level, not by front. I would suggest making all of them working by rear front, as they are much more stable. For example, you can build master-slave JK flip-flop and use it as a base implement all other flip flops you need.
dark32
Posts: 4
Joined: Mon May 18, 2015 12:57 am

Re: Source for Oscillation errors

Post by dark32 »

Sorry Eugene. I don't think I can understand you :( . Can you please show me a circuit example.
User avatar
admin
Site Admin
Posts: 406
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: Source for Oscillation errors

Post by admin »

Sure, download the samples circuits. Open any of them and look at JK flip-flop. They are master-slave synchronized and so working when clock is failing from 1 to 0.
Here you can read a bit more details: http://www.circuitstoday.com/triggering-of-flip-flops
http://www.electronics-tutorials.ws/seq ... seq_2.html
https://tams-www.informatik.uni-hamburg ... /jkff.html
Post Reply