题解 | #使用函数实现数据大小端转换#
使用函数实现数据大小端转换
https://www.nowcoder.com/practice/74c0c19ad0c444959c436a049647a93c
`timescale 1ns/1ns module function_mod( input [3:0]a, input [3:0]b, output [3:0]c, output [3:0]d ); assign c = d_out(a) ; assign d = d_out(b) ; function [3:0] d_out ; input [3:0] data_in ; begin d_out[0] = data_in[3] ; d_out[1] = data_in[2] ; d_out[2] = data_in[1] ; d_out[3] = data_in[0] ; end endfunction endmodule