[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
相关推荐
FPGA小迷弟7 分钟前
FPGA处理图像需要用到的主流接口详解
学习·fpga开发·verilog·fpga·modelsim
LeoZY_30 分钟前
CH347 USB转JTAG功能使用笔记:CH347根据SVF文件实现任意FPGA下载
笔记·stm32·嵌入式硬件·fpga开发·硬件架构·硬件工程
博览鸿蒙32 分钟前
FPGA在高性能计算中的应用:数据流加速与优化
fpga开发
maverick_11134 分钟前
【数字图像处理与FPGA实现】00 绪,建立“算法思维“与“硬件思维“的桥梁
图像处理·fpga开发
乌恩大侠1 天前
【OAI】 USRP 在conf文件中的配置,RU选项
fpga开发
qq_小单车2 天前
xilinx-DNA
fpga开发·xilinx
Flamingˢ2 天前
FPGA中的嵌入式块存储器RAM:从原理到实现的完整指南
fpga开发
Flamingˢ2 天前
FPGA中的存储器模型:从IP核到ROM的深度解析与应用实例
网络协议·tcp/ip·fpga开发
FPGA小c鸡3 天前
【FPGA深度学习加速】RNN与LSTM硬件加速完全指南:从算法原理到硬件实现
rnn·深度学习·fpga开发
Aaron15883 天前
通信灵敏度计算与雷达灵敏度计算对比分析
网络·人工智能·深度学习·算法·fpga开发·信息与通信·信号处理