summaryrefslogtreecommitdiff
path: root/decoder.v
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2017-01-08 21:58:16 -0600
committerBobby Bingham <koorogi@koorogi.info>2017-01-08 23:18:31 -0600
commit17f5cbe781ae761d86d55fec7d46ba3172167894 (patch)
treeb02d0dc075eb94a56cccd49a471e852a6799c266 /decoder.v
parent47cfb7ba2df247310e2160e4e53d1843d4e4d1c8 (diff)
Add carry input to ALU
Diffstat (limited to 'decoder.v')
-rw-r--r--decoder.v3
1 files changed, 3 insertions, 0 deletions
diff --git a/decoder.v b/decoder.v
index d6a1e02..3e08df3 100644
--- a/decoder.v
+++ b/decoder.v
@@ -7,6 +7,7 @@ module decoder (
output [1:0] aluOpSource1, // ALU first operand: 0 = reg, 1 = memory read, 2 = imm8, 3 = PC
output [1:0] aluOpSource2, // ALU second operand: 0 = reg, 1 = ~reg, 2 = PC, 3 = ???
output aluDest, // 0 = reg, 1 = PC
+ output [1:0] aluCarrySource, // ALU carry input source: 0 = zero, 1 = one, 2 = carry, 3 = ~carry
output [2:0] regDest,
output regSetH,
@@ -216,6 +217,8 @@ module decoder (
assign regDest = reg0;
+ assign aluCarrySource = 2'h0;
+
assign regSetH =
instr_mov ? (mov_word | mov_dest_byte_high) :
instr_movimm ? movimm_high :