[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
相关推荐
Riwuarua1 小时前
从近似0基础开始FPGA开发 -- part.11 AXI总线协议与工程应用
fpga开发
自小吃多3 小时前
高云 FPGA 添加时序约束笔记
笔记·fpga开发
学习FPGA的电气小兴兴9 小时前
基于FPGA的CORDIC旋转模式实现sin和cos运算
fpga开发·信号处理·数字信号处理·verilog·fpga·verilog hdl·cordic
blue_ice .11 小时前
DDS原理及简易实现
开发语言·经验分享·笔记·嵌入式硬件·fpga开发
明德扬11 小时前
AD9653采集模块怎样连接FPGA底板?从ADC采样到数据处理
学习·fpga开发·fpga
上海芯聚电子1 天前
ADC与FPGA之间,如何减少板级设计复杂度?
fpga开发·adc
自小吃多1 天前
高云FPGA ModelSim中的仿真
笔记·嵌入式硬件·fpga开发
通信王661 天前
适用于 FPGA 和 SoC 的UltraFast 设计方法指南(1)-UG949
fpga开发
明德扬1 天前
AD9653采集模块、PCIe采集卡和完整采集系统怎么选?
fpga开发·fpga
智塑未来1 天前
FPGA开发板选型:研发交付能力怎么看
人工智能·fpga开发