[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
相关推荐
Joshua-a13 小时前
Quartus命令行烧录FPGA
fpga开发
FPGA_无线通信16 小时前
OFDM FFT 时频域转换
fpga开发
XINVRY-FPGA17 小时前
EP4CE30F23I7N Altera Cyclone IV E SRAM FPGA
嵌入式硬件·fpga开发·云计算·硬件工程·信息与通信·信号处理·fpga
1560820721918 小时前
FPGA(采用RGMII接口)逻辑实现千兆网TCP/IP协议栈调试记录
网络协议·tcp/ip·fpga开发
9527华安19 小时前
FPGA纯verilog实现JESD204B协议,基于AD9250数据接收,提供3套工程源码和技术支持
fpga开发·jesd204b·ad9250
FPGA_无线通信19 小时前
OFDM 精频偏补偿
算法·fpga开发
我爱C编程21 小时前
【仿真测试】基于FPGA的完整16QAM软解调链路实现,含频偏锁定,帧同步,定时点,Viterbi译码,信道,误码统计
fpga开发·16qam·软解调·帧同步·维特比译码·频偏估计·定时点提取
高速上的乌龟1 天前
Lattice LFCPNX-100 Fpga开发+源码:基于spi协议的flash驱动控制
fpga开发
ehiway1 天前
中科亿海微SoM模组——FPGA高速信号采集解决方案
fpga开发
tiantianuser1 天前
RDMA设计13:融合以太网协议栈设计2
fpga开发·rdma·高速传输·cmac·roce v2