This is probably a very basic question, but for the life of me I could not find an answer.
I have this existing logical AND class:
class DelayedAND(val n:Int = 2) extends Module{
val io = IO(new Bundle{
val a = Input(UInt(1.W))
val b = Input(UInt(1.W))
val out = Output(UInt(1.W))
})
val delay = 2
val dand =io.a&io.b
io.out := ShiftRegister(dand, delay)
}
Which I need to include in this Class instead of a regular "and"
class HalfAdder extends Module {
val io = IO(new Bundle{
val a = Input(UInt(1.W))
val b = Input(UInt(1.W))
val sum = Output(UInt(1.W))
val cout = Output(UInt(1.W))
})
val a_xor_b = io.a ^ io.b
io.sum := a_xor_b
val a_and_b = io.a & io.b //previous Class needs to be used here
io.cout := a_and_b
}
I am completely new to Scala and Chisel and I already tried solving it for several hours! Please help me out, thanks!