[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
相关推荐
ShiMetaPi13 小时前
GM-3568JHF丨ARM+FPGA异构开发板应用开发教程:11 RS485读写案例
arm开发·fpga开发·rk3568
1560820721917 小时前
国产时钟AU5615芯片调试记录
fpga开发
嵌入式-老费1 天前
Linux camera驱动开发(特殊的cpu+fpga芯片)
图像处理·驱动开发·fpga开发
ShiMetaPi1 天前
GM-3568JHF丨ARM+FPGA异构开发板应用开发教程:10 以太网测试案例
网络·arm开发·fpga开发·rk3568
Echo_cy_1 天前
ZYNQ嵌入式最小系统配置:ZYNQ7000与ZYNQMP系列
fpga开发·vivado·zynq7000·zynqmp
156082072191 天前
复旦微JFM9RFRF3P/RF3P5G+AI(昇腾310P)全国产采集回放/信号处理模块
人工智能·fpga开发
FPGA小c鸡1 天前
FPGA跨时钟域设计完全指南:从亚稳态到CDC同步器(附实战案例与代码)
fpga开发
FPGA小c鸡3 天前
异步FIFO设计与验证完全指南:从格雷码到CDC同步的深度解析(附SystemVerilog实战代码)
fpga开发
春风细雨无声3 天前
基于FPGA实现PAL视频接口(附代码)
图像处理·fpga开发·视频
算法笑匠3 天前
FPGA驱动AD9226实现65MSPS高速数据采集
fpga·adc·高速数据采集·ad9226