当前位置:网站首页>Floating point multiplication and division of vivado IP core floating point
Floating point multiplication and division of vivado IP core floating point
2022-07-29 06:39:00 【Doze in the wind】
Vivado IP Floating point multiplication and division of kernel Floating-point
Catalog
One 、 Floating point multiplication and division example
Two 、Floating-point IP Core configuration steps
Preface
With the continuous development of manufacturing technology , Field programmable logic gate array (FPGA) More and more integration , More and more applications , Among them, some mathematical processing classes must be used when processing digital signals IP nucleus . Recently, research on Spatial Adaptive Anti-jamming Technology is under way FPGA Hardware implementation , Some of them are inevitably used IP nucleus , Today from Floating point multiplication and division Let's introduce it in detail vivado In the middle of Floating-point This IP Nuclear bar , I hope it can help you in your study .
Tips : The following is the main body of this article , All are original by the author , It's not easy to write an article , I hope you will attach a link to this article when reprinting .
One 、 Floating point multiplication and division example
In order to facilitate the analysis of the results of the later simulation , Here we will give examples of floating-point multiplication and division , The following example is directly used for simulation , To verify whether the simulation results are correct .
example: Set floating point number a=32'b1100_0000_1101_0011_0011_0011_0011_0011, namely a=-6.6, Floating point numbers b=32'b0100_0001_0000_1100_1100_1100_1100_1101, namely b=8.8, be a*b=32'b1100_0010_0110_1000_0101_0001_1110_1100, namely a*b=-58.08,a/b=32'b1011_1111_0100_0000_0000_0000_0000_0000, namely a/b=-0.75.
Two 、Floating-point IP Core configuration steps
1. Multiplier configuration
1. First configuration Operation Selection Interface , Pictured 1 Shown .

2. Next configuration Precision of Inputs Interface , Pictured 2 Shown .

3. Then configure Optimizations Interface , Pictured 3 Shown .

4. Final configuration Interface Options Interface , Pictured 4 Shown .

above 4 After all the interfaces are configured, you can click on the lower right corner OK Button generation Multiplier IP nucleus .
2. Divider configuration
stay vivado Mid search Floating-point, To find the IP After the core, you can complete the corresponding configuration according to the following operations .
1. First configuration Operation Selection Interface , Pictured 5 Shown .

2. Next configuration Precision of Inputs Interface , Pictured 6 Shown .

3. Then configure Optimizations Interface , Pictured 7 Shown .

4. Final configuration Interface Options Interface , Pictured 8 Shown .

above 4 After all the interfaces are configured, you can click on the lower right corner OK Button generation A divider IP nucleus .
3、 ... and 、 Simulation
1. Top level code
Build a top-level module , Name it float_mul_div, Used to instantiate the just generated IP nucleus .
The code is as follows :
`timescale 1ns / 1ps
//
// Company: cq university
// Engineer: clg
// Create Date: 2022/07/23 16:40:34
// Design Name:
// Module Name: float_mul_div
// Project Name:
// Target Devices:
// Tool Versions: 2017.4
// Description:
// Dependencies:
// Revision:1.0
// Revision 0.01 - File Created
// Additional Comments:
//
//
module float_mul_div(
input clk,
input a_tvalid,
input [31:0] a_tdata,
input b_tvalid,
input [31:0] b_tdata,
output mul_result_tvalid,
output [31:0] mul_result_tdata,
output div_result_tvalid,
output [31:0] div_result_tdata
);
float_multiply u1_float_multiply( // Multiplier
.aclk(clk),
.s_axis_a_tvalid(a_tvalid),
.s_axis_a_tdata(a_tdata),
.s_axis_b_tvalid(b_tvalid),
.s_axis_b_tdata(b_tdata),
.m_axis_result_tvalid(mul_result_tvalid),
.m_axis_result_tdata(mul_result_tdata)
);
float_divide u1_float_divide( // A divider
.aclk(clk),
.s_axis_a_tvalid(a_tvalid),
.s_axis_a_tdata(a_tdata),
.s_axis_b_tvalid(b_tvalid),
.s_axis_b_tdata(b_tdata),
.m_axis_result_tvalid(div_result_tvalid),
.m_axis_result_tdata(div_result_tdata)
);
endmodule
2. Simulation code
Build a simulation module , Name it float_mul_div_tb, It is used to simulate the instantiation of the top-level module just now IP nucleus .
The code is as follows :
`timescale 1ns / 1ps
//
// Company: cq university
// Engineer: clg
// Create Date: 2022/07/23 17:03:52
// Design Name:
// Module Name: float_mul_div_tb
// Project Name:
// Target Devices:
// Tool Versions: 2017.4
// Description:
// Dependencies:
// Revision:1.0
// Revision 0.01 - File Created
// Additional Comments:
//
//
module float_mul_div_tb();
reg clk;
reg a_tvalid;
reg [31:0] a_tdata;
reg b_tvalid;
reg [31:0] b_tdata;
wire mul_result_tvalid;
wire [31:0] mul_result_tdata;
wire div_result_tvalid;
wire [31:0] div_result_tdata;
float_mul_div u1_float_mul_div(
.clk(clk),
.a_tvalid(a_tvalid),
.a_tdata(a_tdata),
.b_tvalid(b_tvalid),
.b_tdata(b_tdata),
.mul_result_tvalid(mul_result_tvalid),
.mul_result_tdata(mul_result_tdata),
.div_result_tvalid(div_result_tvalid),
.div_result_tdata(div_result_tdata)
);
always #5 clk=~clk;
initial begin
clk=1'b0;
#15; a_tvalid<=1'b1;
a_tdata<=32'b1100_0000_1101_0011_0011_0011_0011_0011; //-6.6
b_tvalid<=1'b1;
b_tdata<=32'b0100_0001_0000_1100_1100_1100_1100_1101; //8.8
end
endmodule
Four 、 Analysis of simulation results
The simulation results are shown in the figure 9 Shown , Compare the examples of floating-point multiplication and division listed above , It can be seen that this module successfully realizes the multiplication and division of floating-point numbers .

summary
This time, I introduce How do you use it? vivado Medium Floating-point IP Verify the multiplication and division of floating-point numbers .
边栏推荐
猜你喜欢

day13_ Under multithreading

FIR滤波器设计(2)——Vivado调用IP核设计FIR滤波器

虹科分享 | 带你全面了解“CAN总线错误”(三)——CAN节点状态与错误计数器

Maya aces workflow configuration (Arnold and redshift map configuration specification - restore the correct effect of the map under the SP aces process) PS restore the rendered map under the aces proc

【面试题】2022年最新软件测试面试题(400道)【附带答案】持续更新...

基于udp通信的在线多人聊天室

Navicat for Oracle Cannot create oci environment

虹科 | 使用JESD204串行接口高速桥接模拟和数字世界

FIR滤波器设计(1)——利用matlab的fdatool工具箱设计FIR滤波器参数

Vivado IP核之定点数转为浮点数Floating-point
随机推荐
[leetcode brush questions] array 3 - divide and conquer
Day16 set
Arrays & object & System & Math & random & Packaging
Plugin location in mavan
Clickhouse failed to import CSV without error but no data
Vivado IP核之定点数转为浮点数Floating-point
【面试题】2022年最新软件测试面试题(400道)【附带答案】持续更新...
Redshift restore SP effect - SP map export settings and map import configuration
FIR filter design (2) -- vivado calls IP core to design FIR filter
Vivado IP核之浮点数开方 Floating-point
Maya aces workflow configuration (Arnold and redshift map configuration specification - restore the correct effect of the map under the SP aces process) PS restore the rendered map under the aces proc
unsigned right shift
day15_泛型
网络安全学习(二)
虹科为您分享EtherCAT demo,教您如何从其他协议快速过渡到EtherCAT工业总线
虹科分享 | 带您全面认识“CAN总线错误”(一)——CAN总线错误与错误帧
Common server faults and their solutions
day03_ 2_ task
What is the basic principle of Library collision and library collision attack
服务器常见故障及其解决方法