[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
相关推荐
szxinmai主板定制专家7 小时前
RK3568 + CODESYS+实时系统运动控制器PLC,支持 AI 视觉目标检测,预测性维护,混合多系统部署,多路模拟量采集
arm开发·人工智能·嵌入式硬件·fpga开发
GateWorld9 小时前
LCD显示技术完全指南:原理·制造·驱动·FPGA实现之驱动二
fpga开发·lcd显示·fpga点亮屏幕·minilvds
GateWorld12 小时前
LCD显示技术完全指南:原理·制造·驱动·FPGA实现之驱动一
fpga开发·lcd显示·minilvds·fpga点屏
XMAIPC_Robot12 小时前
深度无人机自动驾驶仪,中小型无人机硬件在环仿真飞行
运维·arm开发·人工智能·fpga开发·无人机·边缘计算
小眼睛FPGA1 天前
【紫光HiYou开源入门轻量级PCIE开发板PG2L25G】实验例程1-基于紫光FPGA 的LED 流水灯
fpga开发
不会武功的火柴1 天前
SystemVerilog语法(8)-有限状态机(FSM)
嵌入式硬件·fpga开发·自动化·ic验证·rtl·uvm方法学
Kent Gu1 天前
Lattice FPGA选型
fpga开发
Terasic友晶科技1 天前
答疑解惑|为DE25-Nano开发板配置Linux kernel时.config文件没有起作用是什么原因?
linux·服务器·fpga开发·linux kernel·de25-nano
8K超高清1 天前
CCBN展会多图回顾
人工智能·算法·fpga开发·接口隔离原则·智能硬件
小眼睛FPGA1 天前
【紫光HiYou开源入门轻量级PCIE开发板PG2L25G】实验例程5-DDR3 读写实验例程
fpga开发