[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
相关推荐
GateWorld3 小时前
FPGA DSP模块使用中不易察觉的坑
fpga开发·ip·实战经验·fpga dsp使用
minglie16 小时前
用vio_uart测试verilog
fpga开发
Terasic友晶科技7 小时前
6-DE10-Nano的HDMI方块移动案例——使用Modelsim仿真I2C控制器
fpga开发·仿真·modelsim·hdmi·i2c_controller
我爱C编程21 小时前
【仿真测试】基于FPGA的2ASK扩频通信链路实现,包含帧同步,定时点,扩频伪码同步,信道,误码统计
fpga开发·帧同步·定时点·ask·扩频通信·扩频伪码同步
minglie11 天前
Wokwi组件
fpga开发
qq_337599461 天前
FPGA知识点
经验分享·fpga开发
s09071361 天前
连通域标记:从原理到数学公式全解析
图像处理·算法·fpga开发·连通域标记
FPGA_小田老师1 天前
FPGA例程(4):按键消抖实验
fpga开发·verilog·fpga demo·fpga例程
FPGA小c鸡1 天前
FPGA摄像头采集处理显示完全指南:从OV5640到HDMI实时显示(附完整工程代码)
fpga开发
jz_ddk1 天前
[学习] NCO原理与误差分析
fpga开发·gps·gnss·北斗