Implements sub: passing tests
This commit is contained in:
@@ -5,7 +5,7 @@ import chisel3.util.switch
|
||||
import chisel3.util.is
|
||||
|
||||
object AluOpCode extends ChiselEnum {
|
||||
val Add, And, Or, Xor, ShiftLeft, ShiftRight, ShiftArithmeticRight,
|
||||
val Add, Sub, And, Or, Xor, ShiftLeft, ShiftRight, ShiftArithmeticRight,
|
||||
LessThanSigned, LessThanUnsigned, GreaterEqualSigned,
|
||||
GreaterEqualUnsigned, Equal = Value
|
||||
}
|
||||
@@ -28,6 +28,10 @@ class Alu extends Module {
|
||||
io.out := io.a + io.b;
|
||||
}
|
||||
|
||||
is(Sub) {
|
||||
io.out := io.a - io.b;
|
||||
}
|
||||
|
||||
is(And) {
|
||||
io.out := io.a & io.b;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user