引言
海康今年的实习笔试题目中有一道编程题目,就是关于筛选输入数据中的最大值与次大值。在这里做一个及时的记录。
题目描述
串行输入一个数据序列,要求在对这个序列仅进行1次遍历的情况下,输出最大的两个数。完善如下代码:
module top2_sort #(
parameter DWIDTH = 8
)(
input clk,
input rst_n,
input srst,
input [DWIDTH-1:0] din,
input din_vld,
output reg [DWIDTH-1:0] dout_top1,
output reg [DWIDTH-1:0] dout_top2,
output reg doubt_vld
);
//待完善
//=============================&