[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
相关推荐
尤老师FPGA10 天前
使用DDR4控制器实现多通道数据读写(十六)
fpga开发·ddr4
HX科技10 天前
STM32给FPGA的外挂FLASH进行升级
stm32·嵌入式硬件·fpga开发·flash·fpga升级
sz66cm10 天前
FPGA基础 -- Verilog 驱动强度(drive strength)与电荷强度(charge strength)
fpga开发
海涛高软10 天前
FPGA深度和突发长度计算
fpga开发
hahaha601610 天前
vivado使用非自带的第三方编辑器
fpga开发
芝士不会写代码11 天前
【FPGA学习】DDS信号发生器设计
学习·fpga开发
9527华安11 天前
国产安路FPGA实现MIPI视频解码转HDMI输出,基于SC500摄像头,提供TD工程源码和技术支持
fpga开发·音视频·csi·mipi·dphy·安路fpga·sc500
可编程芯片开发11 天前
基于FPGA的白噪声信号发生器verilog实现,包含testbench和开发板硬件测试
fpga开发·白噪声·snr
风释雪FPGA11 天前
[XILINX]ZYNQ7010_7020_软件LVDS设计
fpga开发
XINVRY-FPGA11 天前
XCVU47P-2FSVH2892E Xilinx Virtex UltraScale+ FPGA AMD
c语言·c++·人工智能·嵌入式硬件·阿里云·fpga开发·fpga