-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from tknopp/nh/signalLimits
Saturate fast DAC Signals with calibrated upper and lower limits
- Loading branch information
Showing
8 changed files
with
281 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
`timescale 1ns / 1ps | ||
|
||
|
||
module signal_limit( | ||
input clk, | ||
input signed [15:0] signal_in, | ||
input signed [15:0] limit_upper, | ||
input signed[15:0] limit_lower, | ||
output [15:0] limited_signal | ||
); | ||
|
||
reg signed [15:0] signal_result; | ||
|
||
always @(posedge clk) | ||
begin | ||
if (signal_in > limit_upper) begin | ||
signal_result <= limit_upper; | ||
end else if (signal_in < limit_lower) begin | ||
signal_result <= limit_lower; | ||
end else begin | ||
signal_result <= signal_in; | ||
end | ||
end | ||
|
||
assign limited_signal = signal_result; | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.