[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
相关推荐
GateWorld10 小时前
FPGA内部模块详解之五FPGA的“对外窗口”——可编程输入输出单元(I/O Logic)
fpga开发·iologic
ZPC821013 小时前
FPGA IP核协议清单
fpga开发
fei_sun14 小时前
FPGA与CPU数据通信(待补充)
fpga开发
m0_5982500014 小时前
FPGA硬件设计-DDR4引脚分配设计规则
fpga开发
XMAIPC_Robot14 小时前
基于RK3588 ARM+FPGA的电火花数控系统设计与测试(三)
运维·arm开发·人工智能·fpga开发·边缘计算
XMAIPC_Robot18 小时前
基于RK3588 ARM+FPGA的电火花数控硬件平台总体设计(二)
运维·arm开发·人工智能·fpga开发·边缘计算
ALINX技术博客20 小时前
【黑金云课堂笔记】第一~二期FPGA知识点总结
笔记·fpga开发
2402910033720 小时前
modelsim入门--从安装到第一个程序
fpga开发
我爱C编程20 小时前
【3.1】基于FPGA的FFT/IFFT模块开发——前言/目录
fpga开发·教程·通信·fft·傅里叶变换
ZPC821020 小时前
RDMA 与RoCE v2
fpga开发