Dot Product Example
- group DotproductExample
Refer riscv_dotproduct_example_f32.c
- Description:
Demonstrates the use of the Multiply and Add functions to perform the dot product. The dot product of two vectors is obtained by multiplying corresponding elements and summing the products.
- Algorithm:
The two input vectors
A
andB
with lengthn
, are multiplied element-by-element and then added to obtain dot product.This is denoted by the following equation:
- Block Diagram:
- Variables Description:
srcA_buf_f32
points to first input vectorsrcB_buf_f32
points to second input vectortestOutput
stores dot product of the two input vectors.
- NMSIS DSP Software Library Functions Used:
riscv_mult_f32()
riscv_add_f32()