Skip to content

Commit

Permalink
fix(sevenseg): correctly calculate digit switch frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
serjzimmerman committed Apr 13, 2024
1 parent 78aa017 commit dbcfc40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/chisel-practice/src/main/scala/blinky/SevenSeg.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class SevenSegHexDisplay(numDigits: Int, digitDivideBy: Int) extends Module {
)

val maxCounter: Int = digitDivideBy;
val (_, counterWrap) = Counter(true.B, digitDivideBy / 2)
val (_, counterWrap) = Counter(true.B, digitDivideBy)

when(counterWrap) {
currentDigit := (currentDigit + 1.U) % numDigits.asUInt
Expand Down Expand Up @@ -85,7 +85,7 @@ class SevenSegTop(

object SevenSegVerilog extends App {
ChiselStage.emitSystemVerilogFile(
new SevenSegTop(4, 6, 270_000, 2_700_000, 0xffff),
new SevenSegTop(4, 6, 135_000, 2_700_000, 0xffff),
args = Array("--target-dir", "generated/blinky"),
firtoolOpts = Array(
"--disable-all-randomization",
Expand Down

0 comments on commit dbcfc40

Please sign in to comment.