题解 | #三元操作符#
三元操作符
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] temp1;
wire [7:0] temp2;
assign temp1 = (a>b)?a:b;
assign temp2 = (c>d)?c:d;
assign max = (temp1>temp2)?temp1:temp2;
endmodule
查看12道真题和解析