[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
相关推荐
cjie2216 分钟前
安路Modelsim仿真库编译
fpga开发
QYR-分析1 小时前
全球及中国电源序列发生器行业市场发展现状与前景分析
fpga开发
alxraves2 小时前
超声图像前端信号处理的关键技术
前端·fpga开发·信号处理
木心术121 小时前
基于FPGA+RFIC的5G基站设计方案与5G专用DFE芯片的设计方案区别及优劣势分析
5g·fpga开发
坏孩子的诺亚方舟1 天前
open_prj21_RGB LCD和HDMI
fpga开发·mpsoc
坏孩子的诺亚方舟1 天前
open_prj20_MPSOC概述
fpga开发·正点原子·mpsoc
nature_forest1 天前
DSP与FPGA之间EMIF接口之DSP参数配置下板测试问题总结
fpga开发
小麦嵌入式1 天前
FPGA入门(三):3-8 译码器 仿真波形解读
stm32·单片机·嵌入式硬件·mcu·fpga开发·硬件工程
upper20202 天前
从零开始动手做Verilog实验--04--11阶FIR滤波器
fpga开发
nuoxin1142 天前
SSD201-富利威
arm开发·驱动开发·fpga开发·ffmpeg·射频工程