The instruction decode

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

The instruction decode

Lindy
I was thinking that it may be easier (for me) if I created a separate chip for instruction decode.  Does that sound like an easy thing to do?

In my head so far, the outputs would be each of the control bits for the ALU and muxen and so on.  Sort of divide it up.  For example one bit if it is to jump or not.

How traditionally is the decode done?  

Thanks!
Lindy
Reply | Threaded
Open this post in threaded view
|

Re: The instruction decode

ybakos
You _could_, but I don't recommend it. The "decode" box in the diagram really does not mean that there is just one chip for the decoding. The decode box and all the d circles together mean, "the stuff you need to build to get the CPU to work."

I recommend picking a starting point, and moving from there. For example, start with the A register, or PC.
Reply | Threaded
Open this post in threaded view
|

Re: The instruction decode

cadet1620
Administrator
In reply to this post by Lindy
One of the problems with making an "instruction decoder" chip is that the interface is very broad -- lots of inputs and outputs that each need a connection in the HDL line that uses the decoder. I found it better to just put the code directly in CPU.hdl.

I do have it all together in a block of code labeled "// Instruction decode".

When I implemented the Hack CPU in Logisim, I did make an InstructionDecoder part. It made for a much cleaner and easier to read circuit given the schematic-based interface Logisim uses.

--Mark