题解 | #三元操作符#

三元操作符

https://www.nowcoder.com/practice/460dd32658f1402382f9a3a65a577a85

`timescale 1ns/1ns

module top_module(
    input [7:0] a, b, c, d,
    output [7:0] max);//
    
    wire [7:0] t1, t2;
    assign t1 = a>b?a:b;
    assign t2 = c>d?c:d;
    assign max = t1>t2?t1:t2;
	//三元操作符
endmodule

全部评论

相关推荐

06-01 21:50
已编辑
天津理工大学 Java
点赞 评论 收藏
分享
Gaynes:查看图片
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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