[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
相关推荐
喵喵苗2 小时前
FPGA Verilog 入门避坑:寄存器与锁存器的本质区别 & 为什么时序逻辑缺 else 不会生成锁存器
fpga开发
Thinker3613 小时前
笔记本外接创新5.1声卡实战:M.2转PCIe软排线方案 vs 雷电扩展卡方案对比
fpga开发·声卡·笔记本外接pcie·显卡坞
传感器与混合集成电路6 小时前
136通道采集模块SPI接口设计:协议结构、时序要求与多模块级联扩展方案
fpga开发
ALINX技术博客1 天前
AMD MoP 封装策略解读 | HBM 大热,为何 AMD Versal 系列反选 LPDDR5X?
fpga开发·fpga·amd·versal
zlinear数据采集卡1 天前
从万用表的6步调零到硅片级微秒自校准:硬核拆解LHAMP188的宽压轨到轨与零漂移实战
arm开发·stm32·单片机·嵌入式硬件·fpga开发
Rambo.xia1 天前
AXI-Stream反压与背靠背传输——TREADY反压丢帧、TDEST路由错误、反压死锁,流式数据一反压就出事
fpga开发
传感器与混合集成电路1 天前
128路模拟通道轮询切换技术解析:模拟开关配置机制与精度影响抑制策略
嵌入式硬件·fpga开发
repokey-Yao1 天前
AI 如何看懂 FPGA 大工程?RepoKey Starter 使用记录
人工智能·chatgpt·fpga
国科安芯1 天前
ASC8T245S 8通道电平转换设计实战:从系统架构到QFN24 Layout再到量产测试
网络·单片机·物联网·安全·fpga开发·系统架构
传感器与混合集成电路2 天前
基于FPGA与ADC协同架构的高密度数据采集模块设计原理与应用场景分析
fpga开发·架构