[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
相关推荐
XINVRY-FPGA19 小时前
XC7VX690T-2FFG1157I Xilinx AMD Virtex-7 FPGA
arm开发·人工智能·嵌入式硬件·深度学习·fpga开发·硬件工程·fpga
R.X. NLOS19 小时前
Zynq AXI DMA 环回测试调试指南:从 Cache 一致性到 Vitis 同步机制
fpga
Terasic友晶科技20 小时前
【案例展示】友晶科技全息传感器桥接解决方案
科技·fpga开发·holoscan·agilex 5·terasic
学习永无止境@20 小时前
Verilog中有符号数计算
图像处理·算法·fpga开发
FPGA-ADDA21 小时前
第四篇:射频数据转换器(RF-DAC)——重构模拟信号的关键
ai·fpga·rfsoc·vu13p·xczu47dr
学习永无止境@1 天前
Sobel边缘检测的MATLAB实现
图像处理·opencv·算法·计算机视觉·fpga开发
fei_sun1 天前
数字芯片流程
fpga开发
YaraMemo1 天前
射频链的构成
5g·fpga开发·信息与通信·信号处理·射频工程
fei_sun1 天前
逻辑设计工程技术基础
fpga开发
fei_sun1 天前
有限状态机设计基础
fpga开发