[HDLBits] Conditional

Given four unsigned numbers, find the minimum. Unsigned numbers can be compared with standard comparison operators (a < b). Use the conditional operator to make two-way min circuits, then compose a few of them to create a 4-way min circuit. You'll probably want some wire vectors for the intermediate results.

复制代码
module top_module (
    input [7:0] a, b, c, d,
    output [7:0] min);//
    wire [7:0] res1,res2;
	assign res1= a<b?a:b;
    assign res2= c<d?c:d;
    assign min=res1<res2?res1:res2;
    // assign intermediate_result1 = compare? true: false;

endmodule
相关推荐
海涛高软12 小时前
verlog中阻塞赋值和非阻塞赋值
fpga开发
tiantianuser14 小时前
RDMA设计29:RoCE v2 发送及接收模块设计2
服务器·fpga开发·rdma·fpga设计·高速传输
9527华安16 小时前
FPGA实现GTP光口视频转USB3.0 UVC,基于Aurora8B10B+FT602芯片架构,提供4套工程源码和技术支持
fpga开发·gtp·usb3.0·uvc·aurora8b10b·ft602
zy1353806757317 小时前
12V输入5V/2A输出升降压芯片AH4002
科技·单片机·物联网·fpga开发·硬件工程·智能电视
dadaobusi17 小时前
verilog的generate
fpga开发
从此不归路18 小时前
FPGA 结构与 CAD 设计(第2章)
ide·fpga开发
FPGA_小田老师18 小时前
FPGA例程(5):时钟(clock)分频倍频(PLL/MMCM)实验--vivado行为级仿真、综合后仿真和实现后仿真说明
fpga开发·pll·mmcm·run simulation·前仿真·后仿真
3有青年18 小时前
HPS cold reset pin和AVST configuration的功能和作用
fpga开发
3有青年1 天前
Altera FPGA操作系统支持的情况分析
fpga开发
国科安芯1 天前
卫星通讯导航FPGA供电单元DCDC芯片ASP4644S2B可靠性分析
单片机·嵌入式硬件·fpga开发·架构·安全性测试