Skip to content

Commit

Permalink
Merge branch 'srt' into srt
Browse files Browse the repository at this point in the history
  • Loading branch information
wissygh authored Apr 25, 2022
2 parents 4821208 + c3c3ed1 commit 63f417a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions arithmetic/src/division/srt/OTF.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ class OTF(radix: Int, qWidth: Int, ohWidth: Int) extends Module {

output.quotient := Mux(cShiftQ, input.quotient, input.quotientMinusOne)(qWidth-2, 0) ## qIn
output.quotientMinusOne := Mux(!cShiftQM, input.quotient, input.quotientMinusOne)(qWidth-2, 0) ## qmIn

}
1 change: 1 addition & 0 deletions arithmetic/src/division/srt/QDS.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ class QDS(rWidth: Int, ohWidth: Int, partialDividerWidth: Int) extends Module {
BitPat("b00001")
)
)

}
4 changes: 3 additions & 1 deletion arithmetic/src/division/srt/SRT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import addition.csa.CarrySaveAdder
import addition.csa.common.CSACompressor3_2
import utils.extend
import chisel3._
import chisel3.util.{log2Ceil, Counter, DecoupledIO, Mux1H, ValidIO}

import chisel3.util.{log2Ceil, Counter, DecoupledIO, Mux1H, ValidIO}
import scala.math.ceil

/** SRT4
Expand All @@ -31,6 +31,7 @@ class SRTOutput(reminderWidth: Int, quotientWidth: Int) extends Bundle {

// only SRT4 currently
class SRT(

dividendWidth: Int,
dividerWidth: Int,
n: Int, // the longest width,
Expand All @@ -55,6 +56,7 @@ class SRT(
val quotient = Reg(UInt(n.W))
val quotientMinusOne = Reg(UInt(n.W))
val counter = RegInit(input.bits.counter)

// Control
// sign of select quotient, true -> negative, false -> positive
val qdsSign: Bool = Wire(Bool())
Expand Down

0 comments on commit 63f417a

Please sign in to comment.