题解 | #使用函数实现数据大小端转换#

使用函数实现数据大小端转换

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 = data_rvs(a);
assign d = data_rvs(b);


function [3:0] data_rvs;
	input [3:0] data;
	integer i;
	begin
		for(i = 0; i < 4; i++)
			data_rvs[i] = data[3-i];
	end
endfunction


endmodule

全部评论

相关推荐

07-07 12:47
门头沟学院 Java
码农索隆:竟然还真有卡体检报告的
点赞 评论 收藏
分享
05-30 12:03
山西大学 C++
offer来了我跪着...:不是骗子,等到测评那一步就知道为啥这么高工资了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务