[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
相关推荐
芯门8 小时前
基于 Xilinx K7 FPGA 的全套万兆 10G GigE Vision 商业级传输方案
计算机视觉·fpga开发·万兆gige
ehiway8 小时前
FPGA在未来产业中的应用潜力与商业机会分析
fpga开发
GateWorld9 小时前
FPGA内部模块详解之第1篇 FPGA内部结构总览
fpga开发·fpga内部模块
爱吃汽的小橘9 小时前
驱动GPIO使用GPIO中断模式
fpga开发
普密斯科技10 小时前
精准把控每一处细节——FPGA焊点高度精准检测实施方案
人工智能·深度学习·数码相机·计算机视觉·fpga开发·测量
FPGA_小田老师12 小时前
Xilinx AXI UART Lite IP核:IP核深度解析
fpga开发·uart·串口通讯·axi转uart
GateWorld14 小时前
FPGA内部模块详解之二 FPGA的逻辑“心脏”——可编程逻辑块(PFU/CLB)深度解析
fpga开发·fpga内部结构
Saniffer_SH15 小时前
【高清视频】如何针对电动汽车进行通信可靠性测试、故障注入与功率分析?
服务器·驱动开发·测试工具·fpga开发·计算机外设·硬件架构·压力测试
博览鸿蒙17 小时前
基于FPGA技术的数字存储示波器设计探讨
fpga开发
Saniffer_SH17 小时前
【高清视频】企业级NVMe SSD (E3.S, U.2)和消费类M.2 SSD拆解分析
服务器·网络·数据库·驱动开发·测试工具·fpga开发·压力测试