[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 小时前
纯FPGA网络通信实现微秒级确定性延迟
网络协议·fpga开发·硬件架构
泡泡糖的中文规格书7 小时前
HDLbits 1.5 学习笔记
fpga开发
幻智星科技8 小时前
FPGA不同品牌开发平台约束文件迁移难题解析
fpga开发·架构·硬件架构
幻智星科技10 小时前
Karatsuba与CSD优化FPGA大数乘法
c++·fpga开发·密码学
星夜离尘5611 小时前
FPGA 实战:W1C 中断状态寄存器,事件置位与软件清除撞在同一拍怎么办
fpga开发
像枫一样12 小时前
STM32串口轮询收发实战教程
arm开发·c++·stm32·单片机·嵌入式硬件·fpga开发·51单片机
传感器与混合集成电路12 小时前
DLM8676计数控制集成电路DC-DC一体化与RS422隔离接口设计
fpga开发
嵌入式软硬件攻城狮1 天前
9.读写DDR测试
fpga开发
幻智星科技1 天前
多通道数据采集DMA设计详解
fpga开发·udp·硬件架构
泡泡糖的中文规格书2 天前
HDLbits 1.4 学习笔记
fpga开发