湘潭大学第3章 运算方法及运算部件
尾数用补码一位Booth乘法,即 部分积 乘数 00.0000 1.01010 11.0011 11.0011 →11.1001 110101 00.1101 00.0110 →00.0011 011010 11.0011 11.0110 * * →11.1011 001101 00.1101 00.1000 →00.0100 000110 11.0011 11.0111 规格化处理 符号位与最高数值位相反,不需左规。 所以 [Y*X]浮=0110 1 Y*X=2-2*(-02 * * 图 规格化浮点乘法运算流程 规格化浮点数乘除运算流程如下图。 * * 本章小结 掌握:定点数补码加减运算规则及溢出判断方法;定点数原码一位乘法和补码一位乘法运算规则;浮点数四则运算的基本步骤 理解:定点数运算器并行进位链的原理和AM2091的工作过程。 了解:两位乘法规则和阵列乘法器;除法规则;浮点数运算器的组成 * * alu code module alu(x, y,instruction,overflow,result); parameter bit_width=4; input [bit_width-1:0]x,y; input [2:0] instruction; output overflow; output [bit_width-1:0] result; reg [bit_width:0] temp; reg [bit_width:0] result; reg overflow; initial overflow=0; * * always@ (x or y or instruction) begin case (instruction) 3b001:begin temp = {x[bit_width-1], x}+{y[bit_width-1],y}; result = temp[bit_width-1 :0]; overflow = temp[bit_width] ^ temp[bit_width-1]; end 3b010:begin temp = {x[bit_width-1], x} + ~{y[bit_width-1],y}+1; result = temp[bit_width-1:0]; overflow = temp[bit_width] ^ temp[bit_width-1]; end 3b011:begin result = xy; end 3b100:begin result = x|y; end 3b101:begin result = x^y; end 3b110:begin result ={1b0,x[bit_width-1:1]}; end 3b111:begin result = {x[bit_width-2:0],1b0}; end default:begin result = 0; overflow =0; end endcase end endmodule * * alu testbench code module alu_tb; parameter bit_width=4; wire [bit_width-1:0] p; wire over; reg [bit_width-1:0] a,b; reg [2:0] instruct; reg clk; initial begin a=1;b=1;instruct=3b111;clk=0; end always #100 clk=~clk; always@(posedge clk) begin a=a+1;if(a==0) b=b+1; end alu m(.x(a),.y(b),.instruction(instruct),.overflow(over),.result(p)); endmodule * * 定点运算器举例 以AM2901A四位双极型位片式结构的运算器为实例,该运算器的逻辑简框图如下。 * * Am2901A运算器特点: 是位片式结构,每片有四位线路,要实现不同位数的运算器,需将几片同样的器件串接起来使用。 该运算器能实现八种运算功能,
您可能关注的文档
最近下载
- 《合肥市新场景规模化应用示范行动方案(2025—2027年)》.pdf
- 标准化审查报告.doc VIP
- (新版)初级民航安全检查员资格考试题库大全-上(单选题汇总) .pdf VIP
- 2023初中毕业上卫校要多少分分数很高吗 .pdf VIP
- (新版)初级民航安全检查员资格考试题库大全-下(多选、判断题汇总).docx VIP
- H3C认证GB0-510 H3CNE-Security网络安全工程师考试题库及答案.docx VIP
- 索尼SW7600GR中文说明书.pdf
- 华三认证考试H3CNE安全 GB0-510 安全工程师考试题库(含答案).docx VIP
- 钢结构厂房水电安装施工组织方案.docx VIP
- 第1课+おじぎ+课文注音讲义 高中日语人教版第一册.docx VIP
原创力文档

文档评论(0)