Confused on CPU.hdl

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

Confused on CPU.hdl

andybendy
Hello! I'm very lost on the CPU and have come to ask some questions/for some recommendations!

What are the A register and ALU doing when the instruction is an A-instruction? We already know what 15 bit address we are going to use/what we are going to output right off the bat when it is an A-instruction, unless I'm mistaken. The use of the ALU makes some more sense to me when it is a C-instruction since the ALU is helping us parse what needs to be output and what address our program counter should be looking at.

Or am I misunderstanding what is going on with the A-instruction/ALU?

Similarly, I'm confused with the program counter, I didn't struggle in building it but I'm struggling with the idea of creating some logic that has it outputting what we want? I believe wiring the in reset to the out reset might be correct. But when would we ever just load the currently loaded address? If we aren't jumping, shouldn't we always be going to the next aka incremented instruction? (Assuming we're not resetting of course.)

I do not have the textbook and I've been using the presentation slides/diagrams/videos (I've rewatched unit 5.3 and unit 4.4 the most, as well as looking back on the previous chips I built and their specifications.)

Any advice on the questions above or additional resources/concepts that I might be missing would be very appreciated, I've been stuck on the CPU alone for over a week and am starting to find myself just frustrated but I don't want to proceed without building it and understanding it.
Reply | Threaded
Open this post in threaded view
|

Re: Confused on CPU.hdl

pm100
a instructions simply load a value into the A register. ALU doesnt do anything
Reply | Threaded
Open this post in threaded view
|

Re: Confused on CPU.hdl

pm100
>>If we aren't jumping, shouldn't we always be going to the next aka incremented instruction?

yes, and the PC tells the CPU what the next instruction is
Reply | Threaded
Open this post in threaded view
|

Re: Confused on CPU.hdl

andybendy
Is it going to instruction memory, effectively picking up an op code, and getting routed back into the CPU?

So is the increment bit controlled by some combination of when the jump bits are 000 or failing to meet whatever logic the conditional jump is checking against? Or because the PC checks last for the increment (from what I gather by reading the PC chip implementation details), I should just handle all the control logic in the load bit? (Sorry if the questions are basic)
Reply | Threaded
Open this post in threaded view
|

Re: Confused on CPU.hdl

andybendy
In reply to this post by pm100
Hey, I just wanted to say thank you for the help! I got my CPU to work today, and it felt amazing! I should go back and rewrite some of it (or maybe a lot of it), but it works as intended.