Stack |///////| |_______|<-- SP | | Calling Seq Receiving Seq | local | | vars | push FP f: push locals |_______| move SP to FP . |__ra___| push params . index locals from FP | | call f pushes ra . | params| return n |_______|<-- FP |__ofp__| The return n instruction pops n local vars, | | pops ra into PC, moves FP to SP, and pops ofp into FP | caller|design a calling sequence for a RISC machine where interrupts must be processed on the same stack as is used for procedure and function calls. Therefore, one of the registers must be used as a stack pointer. Your goal is to eliminate the need for a frame pointer and design the simplest universal calling sequence you can!
For the RISC machine, assume each instruction requires no more than one memory cycle, assume the call instruction stores the return address in a register, and assume that we do not use a frame pointer!
Memory Data Alignment Register MUX __ __ | |---------| |-----------| High | | | | \ / |/ Byte | | | | \ / |------ |__|---------|__|-\ \/ /--| | | \ \ / | 16 bit -- -- \ \ | data from | __ | __ / \ \ | memory | | |---------| |-/ /\ \--| Low | | | | | / \ |------ Byte | | | | | / \ |\ | |__|---------|__|-----------| | | | | Clock high - | | | Mux controls are 2 bits each Clock low ---- | | 00 - output zero Highmux ----- | 01 - output lower input Lowmux -------- 10 - output upper inputDesign a controller for the above alignment network that takes the following signals from the CPU: