diff options
| author | uvok | 2026-01-09 19:36:02 +0100 |
|---|---|---|
| committer | uvok | 2026-01-10 09:54:18 +0100 |
| commit | b3494ea7cc4040adcbfd123f0931116b34d4e9e2 (patch) | |
| tree | 14ca78ebc0d146fd0ceaea7aac713a5108b51f10 /nandgame/instruction_decode.sv | |
| parent | 526bbb2a4618b0ca6e3367bfc9a2bb30476ea3be (diff) | |
Implement halting
Diffstat (limited to 'nandgame/instruction_decode.sv')
| -rw-r--r-- | nandgame/instruction_decode.sv | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nandgame/instruction_decode.sv b/nandgame/instruction_decode.sv index f81f251..b78bee8 100644 --- a/nandgame/instruction_decode.sv +++ b/nandgame/instruction_decode.sv @@ -34,7 +34,9 @@ module instruction_decode #( // whether result should be stored to D output dst_D_out, // whether result should be stored in memory at address in A register - output dst_pA_out + output dst_pA_out, + // Invalid instruction + output invalid_ins ); wire is_immediate_int; @@ -42,6 +44,9 @@ wire is_immediate_int; // bit 15 unset = immediate assign is_immediate_int = !instruction_in[15]; +// bit 14 must be 1 +assign invalid_ins = instruction_in[15] == 1 && instruction_in[14] == 0; + assign dst_A_out = is_immediate_int || instruction_in[5]; assign dst_D_out = !is_immediate_int && instruction_in[4]; assign dst_pA_out = !is_immediate_int && instruction_in[3]; |
