首页 > 其他分享 >FPGA运算符详解

FPGA运算符详解

时间:2023-01-16 21:45:49浏览次数:46  
标签:15 FPGA top module 运算符 详解 output input assign

 

  •  1 module top(    
     2     output        [31:0]     c                 
     3 );
     4 
     5 localparam [15:0]    a = 65535;
     6 localparam [15:0]    b = 25687;
     7 
     8 
     9 assign c = a*b;
    10 //两个常数相乘,综合后不使用资源,直接综合为一个常数
    11 module top(    
    12     output        [15:0]     c                 
    13 );
    14 
    15 localparam [15:0]    a = 65520;
    16 localparam [15:0]    b = 25687;
    17 
    18 
    19 assign c = a/b;
    20 //两个常数相除,综合后不使用逻辑资源,直接综合为一个常数
    21 module top(    
    22     output        [15:0]     c                 
    23 );
    24 
    25 localparam [15:0]    a = 65535;
    26 localparam [15:0]    b = 25687;
    27 
    28 
    29 assign c = a%b;
    30 //两个常数取余,不使用逻辑资源
    31 module top(    
    32     input        [15:0]     a             ,
    33     output        [16:0]     c                 
    34 );
    35 
    36 assign c = a*256;
    37 //变量与2的指数相乘,不会使用逻辑资源,综合为移位的方式
    38 module top(    
    39     input        [15:0]     a             ,
    40     output        [14:0]     c                 
    41 );
    42 
    43 assign c = a/512;
    44 //变量与2的指数相除,不使用逻辑资源,综合为移位的方式
    45 module top(    
    46     input        [15:0]     a             ,
    47     output        [15:0]     c                 
    48 );
    49 
    50 assign c = a%1024; 
    51 //变量与2的指数取余,不使用逻辑资源
    52 module top(        
    53     input        [15:0]     a             ,    
    54     output        [31:0]     c                 
    55 );
    56 
    57 assign c = a*32767;
    58 //变量与非2的指数相乘,综合为LUT,且随着乘数的增大,LUT也会增加,或者直接使用DSP;
    59 module top(        
    60     input        [15:0]     a             ,    
    61     output        [15:0]     c                 
    62 );
    63 
    64 assign c = a/3;
    65 //变量与非2的指数相除,综合为LUT,且LUT占用较多
    66 module top(        
    67     input        [15:0]     a             ,    
    68     output        [15:0]     c                 
    69 );
    70 
    71 assign c = a%32767;
    72 //变量与非2的指数取余,综合为LUT,
    73 module top(    
    74     input        [15:0]     a             ,
    75     input        [15:0]     b             ,
    76     output        [31:0]     c                 
    77 );
    78 
    79 assign c = a*b;
    80 //两个变量相乘,综合为DSP
    81 module top(    
    82     input        [15:0]     a             ,
    83     input        [15:0]     b             ,
    84     output        [15:0]     c                 
    85 );
    86 
    87 assign c = a/b;
    88 //两个变量相除,综合为较多的LUT
    89 module top(    
    90     input        [15:0]     a             ,
    91     input        [15:0]     b             ,
    92     output        [15:0]     c                 
    93 );
    94 
    95 assign c = a%b;
    //两个变量取余,综合为较多的LUT


     

 

标签:15,FPGA,top,module,运算符,详解,output,input,assign
From: https://www.cnblogs.com/tuzki9611/p/17056363.html

相关文章

  • 【ES6】 let与const详解
    【ES6】let与const详解ES6,全称为ECMAScript6。ES6与js的关系是:前者是后者的规格,后者是前者的实现。换句话说,ES是js的国际化版本,js是ES的子集。1.letlet命令和var命令是差......
  • http协议缓存详解
    浏览器端强制缓存,http响应头expires和cache-control是设置缓存的重要参数expires设置到期时间点,这是http1.0的产物,对于客户端时间和服务器端有时差的情况,会导致缓......
  • 【ES6】Module模块详解
    【ES6】Module模块详解​​一、Module的由来​​​​二、严格模式​​​​三、export命令​​​​四、import命令​​​​查看更多ES6教学文章:​​​​参考文献​​引言:由于......
  • 【ES6】Generator函数详解
    【ES6】Generator函数详解​​一、Generator函数简介​​​​基本概念​​​​函数写法​​​​yield关键字介绍​​​​二、next方法的参数​​​​三、for...of循环​​​......
  • 【ES6】Promise对象详解
    【ES6】Promise对象详解​​一、Promise对象的含义​​​​二、Promise对象的用法​​​​三、Promise对象的几个应用【重点】​​​​1、时间延迟函数​​​​2、图片异步......
  • Log4Net组件的应用详解
     第一步:添加并应用Log4net.dll。然后在Web.config文件中添加下面的配置局<configSections><sectionname="log4net"type="log4net.Config.Log4NetConfigurationSectionH......
  • GShang博客园主题高级版本适配教程详解
    主题预览博客Favicon自定义导航栏扩展博客内部公告信息首页轮播信息侧边栏公告信息整合博文发布信息位置调整博文侧边目录博文代码块复制博文作者信息签名博客捷径应用(更多......
  • ChatGPT/InstructGPT详解
    作者:京东零售刘岩​前言GPT系列是OpenAI的一系列预训练文章,GPT的全称是GenerativePre-TrainedTransformer,顾名思义,GPT的目的就是通过Transformer为基础模型,使用预训练技......
  • 神经网络基础部件-损失函数详解
    本文总结分类和回归任务的常用损失函数,比如重点解析了交叉熵损失函数的由来,并给出详细计算公式和、案例分析、代码,同时也描述了MAE和MSE损失函数,给出了详细的计算公式......
  • logging 模块详解
    日志记录函数以它们用来跟踪的事件的级别或严重性命名。下面描述了标准级别及其适用性(从高到低的顺序)日志等级(level)描述DEBUG 最详细的日志信息,典型应用场景是问......