[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
相关推荐
无情的8865 小时前
硬件中的端接设计
fpga开发·硬件工程
快乐的划水a8 小时前
存储器介绍(2)
fpga开发
leixj0258 小时前
MultiBoot中的两个WatchDog时间设置及跳转调试
fpga开发
博览鸿蒙12 小时前
FPGA 经典面试题目及答案汇总
fpga开发·面试·职场和发展
步达硬件1 天前
【FPGA】DP、HDMI、USB4、GPMI、eDP、LVDS等音视频协议及性能对比
fpga开发
-木槿昔年-2 天前
【米尔-安路MYD-YM90X创意秀】飞龙派学习和PS串口实践
学习·fpga开发
Aaron15882 天前
基于RFSOC+VU13P+GPU架构在雷达电子战的技术
人工智能·算法·fpga开发·架构·硬件工程·信号处理·基带工程
jifengzhiling2 天前
伺服驱动器中DSP与FPGA高效协同架构解析
fpga开发·foc电机控制
太爱学习了3 天前
FPGA图像处理之:图像畸变矫正原理及matlab与fpga实现
图像处理·matlab·fpga开发
技术性摸鱼3 天前
FPGA选型参数
fpga开发