[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
相关推荐
逻辑诗篇5 小时前
基于 VPX 架构的 8 路 ADC / 8 路 DAC 信号采集处理板(VPX326)产品解析
fpga开发
菜鸟~noob2332 天前
[AI]间章:系列走到这里,聊聊后面的规划、造卡需要的软件平台,以及为什么我要先暂停更新
人工智能·python·fpga开发·django·pygame
星夜离尘568 天前
FPGA 32 位字拆成 8 位字节:keep、last 与 ready/valid 背压下的多拍序列化
fpga开发·verilog
花月mmc10 天前
【FPGA】神经网络内容简介预告
嵌入式硬件·深度学习·神经网络·fpga开发
LabVIEW开发12 天前
LabVIEW FPGA 编程:少编译几次的办法(系列 04/05)
fpga开发·labview
cmc102812 天前
318.关于在ip内部封装PLL,MMCM的注意事项
fpga开发
LabVIEW开发12 天前
LabVIEW CompactRIO 编程模式怎么选(系列 02/05)
fpga开发·labview
FPGA工程笔记12 天前
Xilinx Divider Generator IP 实战:64位有符号除法、Fractional 输出解析与定点数转换
verilog·fpga·vivado·xilinx·定点数·divider gen·fractional
FPGA小迷弟13 天前
FPGA 与千兆以太网校验和:从原理到 Verilog 实现
嵌入式硬件·fpga开发·无人机·ai编程·fpga
码农小韩13 天前
FPGA学习(二)——LED闪烁
fpga开发·verilog·fpga·led·组合逻辑·分频设计