CN102236539A - 图形芯片设计中求幂算法的实现 - Google Patents
图形芯片设计中求幂算法的实现 Download PDFInfo
- Publication number
- CN102236539A CN102236539A CN2011102020839A CN201110202083A CN102236539A CN 102236539 A CN102236539 A CN 102236539A CN 2011102020839 A CN2011102020839 A CN 2011102020839A CN 201110202083 A CN201110202083 A CN 201110202083A CN 102236539 A CN102236539 A CN 102236539A
- Authority
- CN
- China
- Prior art keywords
- exponentiation
- algorithm
- scope
- depth
- tables
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Image Generation (AREA)
Abstract
本发明公开了一种图形芯片设计中的求幂算法的实现方式,它分为三个步骤:(1)用查找表法将底数求基于2的对数;(2)将对数与指数相乘;(3)对乘数结果求基于2的指数,本发明中将第一步又划分为三个步骤:(1)浮点数定点化;(2)将基于2的对数查找表多级分解成若干小表;(3)查表结果处理,由于在光照算法中将会不可避免的出现大量求幂计算,而直接求幂计算将给硬件带来难以接受的资源压力,这种实现方式既能保证求幂算法的计算精度,又能大幅度减少芯片的资源使用。
Description
技术领域
本发明主要涉及到图形芯片设计中的光照部分实现领域,特指光照中求幂算法的实现。
背景技术
图形芯片的光照作用是增加物体的真实度,在图形芯片中实现光照功能时,在计算镜面反射光和聚光灯光时会不可避免的遇到求幂计算。
由于在光照中求幂计算的输入为确定范围的单精度浮点格式的数据,使用查找表求幂需要占用大量的ROM资源,因此确保求幂运算结果精度、减小芯片面积是本求幂运算的目标。
发明内容
本发明要解决的问题就在于:在经典算法的基础上,利用光照中求幂计算输入值为确定范围,使用泰勒级数展开原理,本发明提供了一种硬件资源消耗不大、运算精度比较高的实现方法。
与现有技术相比,本发明的优点就在于:1、实现简单:本发明提出的多级ROM表分解的实现结构并主要采用的还是ROM表查表实现方式,利于硬件实现;2、资源占用量大幅减少:本发明提出的多级ROM表分解的实现大幅度的减少了资源使用率。
附图说明
图1是查表法实现求幂算法流程图;
图2是本发明提出的多级ROM分解的实现结构。
具体实施方式
以下将结合附图和具体实施例对本发明做进一步详细说明。
如图1所示,本发明中的求幂算法,以最后输出精度为例,得出,先将输入数据底数A和指数B进行浮点数转定点数变换,然后对底数A用查表法求对数,对数结果与指数B相乘,然后对乘数结果用查表法求指数,最后进行定点数转浮点数变换。
如图2所示,本发明的多级ROM分解的实现的具体实施方法为,先将ROM分成9组,对第一组A的取值范围为,则固定为0,因此表ROM0的输入端可以取,同理,另外8组表ROM1到表ROM8的输入端可取为到,然后对后8组进行二次分解,以为例,将分成三份,由泰勒公式可知可将此表ROM1从一个输入端为的512*14bit的表ROM1分解为一个输入端为、的64*14bit的表ROM1_0和 一个输入端为、的32*14bit的表ROM1_1;同理,表ROM2可分解为一个输入端为、的64*14bit的表ROM2_0和 一个输入端为、的32*14bit的表ROM2_1;表ROM3可分解为一个输入端为、的64*14bit的表ROM3_0和 一个输入端为、的32*14bit的表ROM3_1;表ROM4可分解为一个输入端为、的64*14bit的表ROM4_0和 一个输入端为、的32*14bit的表ROM4_1;表ROM5可分解为一个输入端为、的64*14bit的表ROM5_0和 一个输入端为、的32*14bit的表ROM5_1;表ROM6可分解为一个输入端为、的64*14bit的表ROM6_0和 一个输入端为、的32*14bit的表ROM6_1;表ROM7可分解为一个输入端为、的64*14bit的表ROM7_0和 一个输入端为、的32*14bit的表ROM7_1;表ROM8可分解为一个输入端为、的64*14bit的表ROM8_0和 一个输入端为、的32*14bit的表ROM8_1。
Claims (10)
1.图形芯片设计中求幂算法的实现,其输入包含两个单精度浮点数,一个基数A,一个指数B,其中A的范围是[0,1],B的范围是[1,128],输出为单精度浮点数P,其范围是[0,1]。
10.由算法导出,其中p为最后输出数据精度。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011102020839A CN102236539A (zh) | 2011-07-19 | 2011-07-19 | 图形芯片设计中求幂算法的实现 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011102020839A CN102236539A (zh) | 2011-07-19 | 2011-07-19 | 图形芯片设计中求幂算法的实现 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102236539A true CN102236539A (zh) | 2011-11-09 |
Family
ID=44887218
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2011102020839A Pending CN102236539A (zh) | 2011-07-19 | 2011-07-19 | 图形芯片设计中求幂算法的实现 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102236539A (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113296732A (zh) * | 2020-06-16 | 2021-08-24 | 阿里巴巴集团控股有限公司 | 数据处理方法和装置,处理器及数据搜索方法和装置 |
WO2023072226A1 (zh) * | 2021-11-01 | 2023-05-04 | 华为技术有限公司 | 一种多级查找表电路、函数求解方法及相关设备 |
-
2011
- 2011-07-19 CN CN2011102020839A patent/CN102236539A/zh active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113296732A (zh) * | 2020-06-16 | 2021-08-24 | 阿里巴巴集团控股有限公司 | 数据处理方法和装置,处理器及数据搜索方法和装置 |
CN113296732B (zh) * | 2020-06-16 | 2024-03-01 | 阿里巴巴集团控股有限公司 | 数据处理方法和装置,处理器及数据搜索方法和装置 |
WO2023072226A1 (zh) * | 2021-11-01 | 2023-05-04 | 华为技术有限公司 | 一种多级查找表电路、函数求解方法及相关设备 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106897046B (zh) | 一种定点乘累加器 | |
CN102629189B (zh) | 基于fpga的流水浮点乘累加方法 | |
CN107305484B (zh) | 一种非线性函数运算装置及方法 | |
CN103984522B (zh) | Gpdsp中定点和浮点混合除法的实现方法 | |
EP3447634A1 (en) | Non-linear function computing device and method | |
CN106951211A (zh) | 一种可重构定浮点通用乘法器 | |
CN104133656A (zh) | 一种尾码采用移位和减法运算的浮点数除法器及运算方法 | |
CN108196822A (zh) | 一种双精度浮点开方运算的方法及系统 | |
CN103135960A (zh) | 一种基于fpga的集成浮点运算器的设计方法 | |
CN111078187B (zh) | 一种针对单精度浮点数的任意次方根求解方法及其求解器 | |
Malík | High throughput floating point exponential function implemented in FPGA | |
CN104166535B (zh) | 定点处理器及其防溢方法 | |
CN104636114B (zh) | 一种浮点数乘法的舍入方法及装置 | |
Sharma et al. | Modified booth multiplier using wallace structure and efficient carry select adder | |
CN102236539A (zh) | 图形芯片设计中求幂算法的实现 | |
Lyu et al. | PWL-based architecture for the logarithmic computation of floating-point numbers | |
CN111984226B (zh) | 一种基于双曲cordic的立方根求解装置及求解方法 | |
US9720648B2 (en) | Optimized structure for hexadecimal and binary multiplier array | |
CN104615404A (zh) | 一种基于查表操作的高速浮点除法部件装置 | |
CN102073473A (zh) | 基于fpga的十进制浮点乘法器设计 | |
Merchant et al. | Efficient realization of table look-up based double precision floating point arithmetic | |
CN102609236B (zh) | 一种应用于gpu中的幂指数运算装置和运算方法 | |
Hsiao et al. | Design of a low-cost floating-point programmable vertex processor for mobile graphics applications based on hybrid number system | |
Chang et al. | Fixed-point computing element design for transcendental functions and primary operations in speech processing | |
Chen et al. | A dynamic non-uniform segmentation method for first-order polynomial function evaluation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C53 | Correction of patent for invention or patent application | ||
CB02 | Change of applicant information |
Address after: 410205 Hunan province Changsha Hexi Lugu high tech Zone base Lu Jing Road No. 2 Changsha Productivity Promotion Center Applicant after: Changsha Jingjia Microelectronic Co., Ltd. Address before: 410205 Hunan province Changsha Hexi Lugu high tech Zone base Lu Jing Road No. 2 Changsha Productivity Promotion Center Applicant before: Changsha Jingjia Microelectronics Co., Ltd. |
|
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20111109 |