package projet import chisel3._ object Utils { def two_complement(x: UInt, word_sized: Bool = false.B): UInt = { val result = Wire(UInt(64.W)) when(word_sized) { result := "xFFFFFFFF".U - x + 1.U }.otherwise { result := "xFFFFFFFFFFFFFFFF".U - x + 1.U } result } }