This commit is contained in:
2024-07-12 00:02:09 +08:00
parent cd649097aa
commit ee78aabc48

View File

@@ -39,8 +39,8 @@ module ControlUnit (
assign memory_write = (opcode == 6'h2b) ? 1 : 0; assign memory_write = (opcode == 6'h2b) ? 1 : 0;
assign ALU_function = (opcode == 6'h0 && funct == 6'h24) ? 5'b00000: assign ALU_function = ((opcode == 6'h0 && funct == 6'h24) || opcode == 6'hc) ? 5'b00000:
(opcode == 6'h0 && funct == 6'h25) ? 5'b00001: ((opcode == 6'h0 && funct == 6'h25) || opcode == 6'hd) ? 5'b00001:
(opcode == 6'h0 && (funct == 6'h22 || funct == 6'h23)) ? 5'b00110: (opcode == 6'h0 && (funct == 6'h22 || funct == 6'h23)) ? 5'b00110:
(opcode == 6'ha || (opcode == 6'h0 && funct == 6'h2a)) ? 5'b00111: (opcode == 6'ha || (opcode == 6'h0 && funct == 6'h2a)) ? 5'b00111:
(opcode == 6'hb || (opcode == 6'h0 && funct == 56'h2b)) ? 5'b01000: (opcode == 6'hb || (opcode == 6'h0 && funct == 56'h2b)) ? 5'b01000:
@@ -71,6 +71,5 @@ module ControlUnit (
(funct == 6'h0 || funct == 6'h2 || (funct == 6'h0 || funct == 6'h2 ||
funct == 6'h3))) ? 0 : 1; funct == 6'h3))) ? 0 : 1;
assign extendop = (opcode == 6'hf) ? 2'b10: assign extendop = (opcode == 6'hf) ? 2'b10 : (opcode == 6'hc) ? 2'b01 : 2'b00;
(opcode == 6'hc) ? 2'b01:2'b00;
endmodule endmodule