使用状态机解析收到的数据帧,利用状态机判断帧头,16'h5555,16'h5555,16'h5500,16'hAA12,提取特定的参数上报或者进行其他操作。
代码:
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2024/10/23 17:24:46
// Design Name:
// Module Name: parameter_extraction
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module parameter_extraction (
input wire clk, // 时钟信号
input wire rst_n, // 复位信号,低电平有效
input wire [15:0] data_in, // 输入数据
input wire data_in_ena, // 输入数据使能
output reg [7:0] data_out, // 输出数据(低8位加0x03)
output reg d

最低0.47元/天 解锁文章
1307

被折叠的 条评论
为什么被折叠?



