svgb/rtl/cpu/alu16.sv
Koray Yanik fda176d3b5 Complete rewrite from scratch, bootstrap WIP
Rewrite to use several bus multiplexers, resulting into a less messy
microarchitecture (hopefully). Some more room for cleanup though...

Supports every instruction from the bootstrap rom, more or less.
LY hacked at 0x90 to progress through vsync instantly.
No cartridge is present yet, so we will always fail checksum test and lock up.
2023-10-01 23:00:56 +01:00

22 lines
465 B
Systemverilog

`include "cpu_pkg.svh"
import cpu_pkg::*;
module alu16 (
input logic [15:0] operand_in_i,
output logic [15:0] operand_out_o,
input logic increment_i,
input logic decrement_i
);
logic [15:0] op_inc;
logic [15:0] op_dec;
assign op_inc = (operand_in_i + 16'h01);
assign op_dec = (operand_in_i - 16'h01);
assign operand_out_o = ({16{increment_i}} & op_inc) |
({16{decrement_i}} & op_dec);
endmodule : alu16