[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
相关推荐
s09071364 小时前
FPGA实现Gamma校正的系统性指南
图像处理·fpga开发·gama校正
读书点滴4 小时前
FPGA中如何获取任何一条路径的延时
fpga开发
minglie14 小时前
嵌入式协程AlarmProtothread
mcu·fpga开发
Godspeed Zhao5 小时前
自动驾驶中的传感器技术79——Sensor Fusion(2)
人工智能·fpga开发·自动驾驶
ShiMetaPi6 小时前
GM-3568JHF丨ARM+FPGA异构开发板系列教程:外设教程 07 音频
arm开发·fpga开发·音视频·fpga·rk3568
bitQ15 小时前
ZBoot-MP:ZYNQ 多介质 Linux 启动与升级解决方案
fpga开发
我爱C编程1 天前
【1.22】基于FPGA的Costas环开发课程学习总结
学习·fpga开发·costas环
FPGA_无线通信1 天前
USB3.0 GPIF II接口
fpga开发
Terasic友晶科技1 天前
5-DE10-Nano的HDMI方块移动案例——基于FPGA的I2C控制模块设计
单片机·嵌入式硬件·fpga开发·时钟分频·hdmi方块移动·i2c控制模块设计·配置寄存器
Joshua-a1 天前
AGM FPGA AG10K 使用Supra新建Quartus工程开发教程
fpga开发