[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
相关推荐
电棍233几秒前
verilog测试平台设计与verilog的synthesis
fpga开发
Bit流2 小时前
记录此刻:历时两月,初步实现基于FPGA的NVMe SSD固态硬盘存储控制器设计!
fpga开发·#fpga nvme ssd·# nvme ssd 读取·#fpga nvme协议实现
Florence237 小时前
GPU和FPGA的区别
fpga开发
电棍23320 小时前
verilog笔记
笔记·fpga开发
ZxsLoves1 天前
【【Systemverilog学习参考 简单的加法器验证-含覆盖率】】
学习·fpga开发
Ronin-Lotus1 天前
嵌入式硬件篇---数字电子技术中的触发器
嵌入式硬件·fpga开发·触发器·数字电子技术·上位机知识
ehiway2 天前
FPGA+GPU+CPU国产化人工智能平台
人工智能·fpga开发·硬件工程·国产化
蓑衣客VS索尼克2 天前
什么是逻辑分析仪?
arm开发·人工智能·fpga开发
啄缘之间3 天前
4.6 学习UVM中的“report_phase“,将其应用到具体案例分为几步?
学习·verilog·uvm·sv
Terasic友晶科技3 天前
第29篇 基于ARM A9处理器用C语言实现中断<五>
c语言·fpga开发·定时器中断