写完编解码模块

This commit is contained in:
RuigeLee
2025-09-05 11:11:01 +08:00
parent f609945a6a
commit 26344d60cd
2 changed files with 69 additions and 1 deletions

View File

@@ -63,3 +63,23 @@ object Dualb4b5Decoder{
Cat( b4b5Decoder(enq(9,5)), b4b5Decoder(enq(4,0)) )
}
}
class b4b5DualEncode extends Module with RequireAsyncReset{
val io = IO(new Bundle{
val dataIn = Input(UInt(8.W))
val isEnable = Input(Bool())
val dataOut = Output(UInt(10.W))
})
io.dataOut := Dualb4b5Encoder(io.dataIn)
}
class b8b10Decode extends Module with RequireAsyncReset{
val io = IO(new Bundle{
val dataIn = Input(UInt(10.W))
val dataOut = Output(UInt(8.W))
})
io.dataOut := Dualb4b5Decoder(io.dataIn)
}