A simple aritmetic and logic unit
void ALU(bool aluop, bool funct, bool bNegate, bool aNegate, bool B[32], bool A[32], bool output[32]) { bool aluop_and = aluop && funct; bool aluop_or = aluop || funct; bool aluop_xor = aluop ^ funct; bool aluop_nor = !(aluop_or); bool aluop_add = aluop_xor; bool aluop_addi = aluop_and; bool aluop_sub = aluop_or; bool aluop_slt = aluop_nor; bool B_logical_negated = bNegate; bool A_logical_negated = aNegate; bool output_value = aluop_add; bool output_value = output_value && (!(A_logical_negated) && !(B_logical_negated)); bool output_