Computer Chip not working

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Computer Chip not working

Arjun Daddikar
While testing Computer.hdl ,the first C-instruction of the loaded file took 2 time units to execute while all the other instructions took the required amount of time to execute.
The memory and the CPU implementations are correct as the Script-Based simulation's result was:
"End of Script-Comparison ended successfully" and I tried interactive simulation and got the desired result for the Memory and the CPU chip. I am not able to understand this problem. Any suggestion?
Reply | Threaded
Open this post in threaded view
|

Re: Computer Chip not working

WBahn
Administrator
Look at the Computer.tst file.

You'll see that the first clock cycle is a reset signal, which holds the PC at 0.
Reply | Threaded
Open this post in threaded view
|

Re: Computer Chip not working

Arjun Daddikar
I don't think that changes anything.
Reply | Threaded
Open this post in threaded view
|

Re: Computer Chip not working

WBahn
Administrator
Isn't the issue you are asking about is why the first instruction seems to take two clock cycles to execute?

The answer is that it doesn't. The first clock cycle the chip is in reset and the second clock cycle is when it executes the first instruction. So the PC is 0 for both of those clock cycles, but for different reasons.

If that's not the problem you are trying to explain, please try to explain the problem in more detail.
Reply | Threaded
Open this post in threaded view
|

Re: Computer Chip not working

Arjun Daddikar
Thanks for the answer WBahn. I have figured out the problem.
Reply | Threaded
Open this post in threaded view
|

Re: Computer Chip not working

WBahn
Administrator
So what was the problem and what was the fix? It might be of use to others.
Reply | Threaded
Open this post in threaded view
|

Re: Computer Chip not working

Arjun Daddikar
Problem:
What happened was, that you told me to look properly at the PC. While doing that, I noticed that because of the circle problem I had stored the output of the PC into a register which made the computer slow.

Fix:
I have still not figured that out.
Reply | Threaded
Open this post in threaded view
|

Re: Computer Chip not working

Arjun Daddikar
In reply to this post by WBahn
While trying to fix the PC problem, I removed the register which stored the output of the PC. To prevent the circle problem, I tried to put the output of the ROM into a register.
But even that made the computer slow.