Alright, I am fetching a 32-bit binary string from the Instruction Memory class. How do I go about "parsing" the string for each binary address. This way I can store each of the memory addresses in a temporary variable before passing the instruction onto the ALU?
Also some of the strings will have leading zeros to account for the entire 32-bits. How can you determine between the actual addresses and the "extended" zeros?
Each of these point to an address. The Op is the most important, because I want to read the Op to see what the instruction is. For instance, if ADD then send the rest of the string (with extending zeros to make 32-bit string) to the ALU.
What is the exact specification of your problem? Decode MIPS instructions written in string that contains characters '0' and '1'. Are there any restrictions that make your problem more specific. Something about the instruction format?
(I mean the MIPS instruction format is just something I found in google that looks like your problem. But it appears complex. Unless someone have done this before, it is unlikely that they will tell you how to decode those instructions straight off the bat.)
Yes, and particularly, what is the specification of the decoder. What is supposed to be the mapping between this binary string and the instruction string? There is no default/conventional one, so this should have been explained somehow.
Also, to be certain, I ask once more. Your input and output are character strings, right? This is of secondary importance, but still.