[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
相关推荐
FPGA_无线通信2 分钟前
USB3.0 GPIF II接口
fpga开发
Terasic友晶科技41 分钟前
5-DE10-Nano的HDMI方块移动案例——基于FPGA的I2C控制模块设计
单片机·嵌入式硬件·fpga开发·时钟分频·hdmi方块移动·i2c控制模块设计·配置寄存器
Joshua-a1 小时前
AGM FPGA AG10K 使用Supra新建Quartus工程开发教程
fpga开发
西安同步高经理1 小时前
脉冲信号发生器时序控制核心、延迟信号发生器、时间间隔发生器
fpga开发
FPGA_小田老师3 小时前
FPGA基础知识(二十一):xilinx FPGA中常用的原语
fpga开发·bufg·ibufds·obufds·iobuf·差分转单端·inout选择
minglie13 小时前
Tang-Nano-1K测试
fpga开发
千歌叹尽执夏3 小时前
FPGA:自定义AXI-FIFO主机接口(含versal读写工程)
fpga开发·ddr4·axi总线·versal·自定义fifo
可编程芯片开发16 小时前
基于FPGA的数字示波器设计和硬件调试,将正弦波形通过HDMI接口在屏幕上动态显示
fpga开发·hdmi·数字示波器·正弦波形
风_峰1 天前
AMD FPGA产品系列讲解
fpga开发
碎碎思1 天前
FINN:FPGA AI 推理新范式 —— 定制化、高性能、量化神经网络编译器框架
人工智能·深度学习·神经网络·机器学习·fpga开发