- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Develop a Verilog model for a peak detector that finds the maximum value in a sequence of 10-bit unsigned integers. A new number arrives
at the input during a clock cycle when the data_en input is 1. If the new number is greater than the previously stored maximum value, the maximum value is updated with the new number; otherwise, it is unchanged. The stored maximum value is cleared to zero when the reset control input is 1. Both data_en and reset are synchronous control inputs. Please help, thanks!Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Homework?
module peak_detect(
input wire clk,
input wire reset,
input wire data_en,
input wire in,
output reg peak );
always @ (posedge clk)
if (reset) peak <= 0;
else if (data_en && (in > peak))
peak <= in;
endmodule
Cheers, Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Homework?
module peak_detect(
input wire clk,
input wire reset,
input wire data_en,
input wire in,
output reg peak );
always @ (posedge clk)
if (reset) peak <= 0;
else if (data_en && (in > peak))
peak <= in;
endmodule
Cheers, Alex --- Quote End --- Thanks Alex.... i got it done yesterday... thanks anyway :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Homework?
module peak_detect(
input wire clk,
input wire reset,
input wire data_en,
input wire in,
output reg peak );
always @ (posedge clk)
if (reset) peak <= 0;
else if (data_en && (in > peak))
peak <= in;
endmodule
Cheers, Alex --- Quote End --- Hey Alex... do you know how to detect several peaks?

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page