Skip to content

Commit

Permalink
Update alchitry_top.luc
Browse files Browse the repository at this point in the history
  • Loading branch information
dheijl committed Nov 16, 2024
1 parent 1700987 commit a1ecb69
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions IO_experiments/source/alchitry_top.luc
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,22 @@ module alchitry_top (
} else if (prv) { // previous digit position
digit_index.d = digit_index.q - 1
} else if (enter) { // advance state machine
digit_index.d = 0 // reset to 1st digit
case (state.q) {
State.A:
a.d = digit_adder.q // remember x value
digit_adder.d = 4x{{4h0}}
state.d = State.B // set next state
State.B:
b.d = digit_adder.q // remember y value
digit_adder.d = 4x{{4h0}}
state.d = State.SUM // set next state (activates bcd adder)
State.SUM:
state.d = State.A // set next state
default:
// should not happen
state.d = State.A
}
// clean-up for next state
digit_adder.d = 4x{{4h0}} // clear a or b
digit_index.d = 0 // reset to enter 1st digit
}

usb_tx = usb_rx // loop serial port
Expand Down

0 comments on commit a1ecb69

Please sign in to comment.