Skip to content

Commit

Permalink
feat: clarify xp-4
Browse files Browse the repository at this point in the history
  • Loading branch information
natalieagus committed Apr 15, 2024
1 parent 0afaee2 commit 5080d33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Software/o_virtualmachine.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ At each CLK cycle, the Control Unit always checks whether `IRQ` is `1` or `0`.
{: .note-title}
> `IRQ` is Asynchronous
>
> Note that `IRQ` may turn to be `1` asynchronously, e.g: in the "*middle*" of a particular CPU CLK cycle. However the Control Unit is synchronised with CPU CLK. Therefore, this will only *trigger* an interrupt in the next CPU CLK tick.
> Note that `IRQ` may turn to be `1` asynchronously, e.g: in the "*middle*" or even towards the end of a particular CPU CLK cycle. However the Control Unit is synchronised with CPU CLK. Therefore, this may only *trigger* an interrupt in the next CPU CLK tick. The exact implementation is <span class="orange-bold">hardware dependent</span>.
> * If `IRQ==0`, the Control Unit produces all control signals as dictated by `OPCODE` received.
> * Else if `IRQ==1`, the Control Unit *traps* the PC onto the interrupt handler located at `XAddr`, by setting `PCSEL` value into `100`; *so that the PC points to `XAddr` in the next clock cycle.*
> * At the same time, it stores the address of the *next* instruction (`PC+4`) at Register `XP` (`R30`).
Expand Down

0 comments on commit 5080d33

Please sign in to comment.