[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
相关推荐
Saniffer_SH18 小时前
【每日一题】PCIe答疑 - 接大量 GPU 时主板不认设备或无法启动和MMIO的可能关系?
运维·服务器·网络·人工智能·驱动开发·fpga开发·硬件工程
会编程是什么感觉...18 小时前
硬件 - 常见通信协议整合
单片机·嵌入式硬件·fpga开发
Saniffer_SH19 小时前
【每日一题】讲讲PCIe链路训练和枚举的前后关系
运维·服务器·网络·数据库·驱动开发·fpga开发·硬件工程
s09071361 天前
ZYNQ 中 AXI BRAM 的使用详细的说明。
fpga开发·zynq
哎呦喂研究院1 天前
FPGA:重构硬件逻辑的柔性算力核心,国产替代的破局关键
fpga开发
国科安芯2 天前
国产RISC-V架构MCU在工控系统中的节能性分析
网络·单片机·嵌入式硬件·fpga开发·性能优化·架构·risc-v
博览鸿蒙2 天前
集成电路基础知识经典问答(面向 FPGA 工程师版)
fpga开发
s09071362 天前
Xilinx FPGA 中ADC 数据下变频+ CIC 滤波
算法·fpga开发·fpga·zynq
9527华安2 天前
FPGA纯verilog实现JESD204B协议,基于AD9208数据接收,提供工程源码和技术支持
fpga开发·xilinx·jesd204b·ad9208·uv9p·vcu118
范纹杉想快点毕业2 天前
FPGA面试百问:从基础到实战全解析
fpga开发