Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in ch2.10 #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 02-Finite-Impulse-Response-Filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ width是1到1024之间的整数。例如,ap_int<8>是一个8位有符号数(

为实现这一点,我们必须了解在执行算术运算时,位宽如何增加。考虑运算a = b + c,其中b为ap\_uint<10> 、c为ap\_uint<10> ,那么变量a的数据类型是什么?在这里我们可以做一个最坏情况的分析,假设a和b都是最大值 $$2^(10) = 1024$$。二者相加结果为a = 2024,可以表示为11位无符号数,即,ap\_uint< 11 >。一般来说,在做加法时,运算结果要比两个加数中最大数值的位宽还要多一位。也就是说,当ap\_uint<x> b和ap_uint<y> c相加时,a的数据类型为ap\_uint<z>,其中 z = max(x, y) + 1。这个结论同样适用于有符号数加法。

通过以上方法解决了acc数据类型设计的部分问题,但是我们还必须处理乘法运算。使用相同的术语,我们希望通过x和y的数据位宽来确定数值z的数据位宽(即,ad_int<z> a , ap_int<x> b,ap_int<y> c)。对于运算a = b∗c,我们不再详细介绍,位宽的运算公式为z = x + y。
通过以上方法解决了acc数据类型设计的部分问题,但是我们还必须处理乘法运算。使用相同的术语,我们希望通过x和y的数据位宽来确定数值z的数据位宽(即,ap_int<z> a , ap_int<x> b,ap_int<y> c)。对于运算a = b∗c,我们不再详细介绍,位宽的运算公式为z = x + y。

{% hint style='info' %}

Expand Down