• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Anyone do hardware level programming (RTL)?

polarmystery

Diamond Member
Hey guys,

I'm trying to figure out whether or not I'm on the right track with a problem. I'm trying to write some RTN for a SRC that swaps the values of two registers. I'm fairly new to RTL so I'm not sure if I'm close, but this is what I have so far:

Code:
swap (:=op=7) -> M[ra]<-R[ra]:M[rb]<-R[rb] ; R[rb]<-M[ra]:R[ra]<-M[rb]:

It makes sense in that the contents of the registers ra and rb are being swapped and loaded into memory, then the memory contents are being loaded back into the corresponding registers, but I feel like I'm missing something. Any help?

For reference, this is the problem statement:
Modify the SRC instruction to include the swap (op=7) instruction that exchanges the contents of two registers, ra and rb, by writing abstract RTN for the new instruction.
 
Oh crap. Was this homework?

I'm sure it was 🙂. I gave it a look when the OP first posted. I think he went about it the right way. He posted the question, outlined what he was struggling with, and asked for help openly.

No foul here, imo.
 
I'm sure it was 🙂. I gave it a look when the OP first posted. I think he went about it the right way. He posted the question, outlined what he was struggling with, and asked for help openly.

No foul here, imo.

Yeah it was. I couldn't figure out if I was on the right track or not. I got little or no help from my professor and using my book, the register to memory back to register transfer of information seems to go throughout the text. I don't think the XOR logic is the only answer, but I didn't understand how memory would become FUBAR using my original implementation, and the XOR logic made much more sense.

Thanks again guys!
 
Back
Top