⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m3s055ct.v

📁 这是16位定点dsp源代码。已仿真和综合过了
💻 V
字号:
//*******************************************************************       ////IMPORTANT NOTICE                                                          ////================                                                          ////Copyright Mentor Graphics Corporation 1996 - 1998.  All rights reserved.  ////This file and associated deliverables are the trade secrets,              ////confidential information and copyrighted works of Mentor Graphics         ////Corporation and its licensors and are subject to your license agreement   ////with Mentor Graphics Corporation.                                         ////                                                                          ////These deliverables may be used for the purpose of making silicon for one  ////IC design only.  No further use of these deliverables for the purpose of  ////making silicon from an IC design is permitted without the payment of an   ////additional license fee.  See your license agreement with Mentor Graphics  ////for further details.  If you have further questions please contact        ////Mentor Graphics Customer Support.                                         ////                                                                          ////This Mentor Graphics core (m320c50eng v1999.010) was extracted on         ////workstation hostid 800059c1 Inventra                                      //// 16-bit Adder// Copyright Mentor Graphics Corporation and Licensors 1998.// V1.0// m3s055ct// M320C50 Auxillary register arithmetic unit adder.// 16-bit look-ahead adder with carry in and carry out`define C_Carry_Slice 4  // Number of bits in a carry slicemodule m3s055ct (CarryIn, AdderIpA, AdderIpB, AdderOp, CarryOut);//*******************************************************************       ////IMPORTANT NOTICE                                                          ////================                                                          ////Copyright Mentor Graphics Corporation 1996 - 1998.  All rights reserved.  ////This file and associated deliverables are the trade secrets,              ////confidential information and copyrighted works of Mentor Graphics         ////Corporation and its licensors and are subject to your license agreement   ////with Mentor Graphics Corporation.                                         ////                                                                          ////These deliverables may be used for the purpose of making silicon for one  ////IC design only.  No further use of these deliverables for the purpose of  ////making silicon from an IC design is permitted without the payment of an   ////additional license fee.  See your license agreement with Mentor Graphics  ////for further details.  If you have further questions please contact        ////Mentor Graphics Customer Support.                                         ////                                                                          ////This Mentor Graphics core (m320c50eng v1999.010) was extracted on         ////workstation hostid 800059c1 Inventra                                      //    input         CarryIn;    input  [15:0] AdderIpA, AdderIpB;    output [15:0] AdderOp;    output        CarryOut;    reg [15:0] Adder_s, Adder_c, AdderOp;    reg  [3:0] Carry_Prop, Carry_Gen;    wire       CarryOut1, CarryOut2, CarryOut3, CarryOut;    reg  [3:0] nC;// 4-bit adderfunction [3:0] Sum4;    input [`C_Carry_Slice-1:0] Data;    input [`C_Carry_Slice-2:0] Bit_Carry;    input Carry;    reg [3:0] C;    begin        C[0] = Carry;        C[1] = Bit_Carry[0] | (Carry & Data[0]);        C[2] = Bit_Carry[1] | (Bit_Carry[0] & Data[1]) | (Carry & Data[0] & Data[1]);        C[3] = Bit_Carry[2] | (Bit_Carry[1] & Data[2]) |                (Bit_Carry[0] & Data[1] & Data[2]) | (Carry & Data[0] & Data[1] & Data[2]);        Sum4 = {Data[3]^C[3], Data[2]^C[2], Data[1]^C[1], Data[0]^C[0]};    endendfunction// Single-bit sum and carrysalways @(AdderIpA or AdderIpB)begin    Adder_s = AdderIpA ^ AdderIpB;    Adder_c = AdderIpA & AdderIpB;end// 4-bit carry propagate/generatealways @(Adder_s or Adder_c)    for (nC=0; nC<=3; nC=nC+1)    begin        Carry_Prop[nC] = Adder_s[nC*`C_Carry_Slice] & Adder_s[nC*`C_Carry_Slice+1] &                        Adder_s[nC*`C_Carry_Slice+2] & Adder_s[nC*`C_Carry_Slice+3];        Carry_Gen[nC] = (Adder_c[nC*`C_Carry_Slice] & Adder_s[nC*`C_Carry_Slice+1] &                        Adder_s[nC*`C_Carry_Slice+2] & Adder_s[nC*`C_Carry_Slice+3]) |                       (Adder_c[nC*`C_Carry_Slice+1] & Adder_s[nC*`C_Carry_Slice+2] &                        Adder_s[nC*`C_Carry_Slice+3]) |                       (Adder_c[nC*`C_Carry_Slice+2] & Adder_s[nC*`C_Carry_Slice+3]) |                        Adder_c[nC*`C_Carry_Slice+3];    end// Look-ahead carriesm3s056ct U1 (CarryIn, Carry_Prop, Carry_Gen, CarryOut1, CarryOut2, CarryOut3, CarryOut);// Add in carriesalways @(Adder_s or Adder_c or CarryIn or CarryOut1 or CarryOut2 or CarryOut3)begin    AdderOp[3:0] = Sum4(Adder_s[3:0], Adder_c[2:0], CarryIn);    AdderOp[7:4] = Sum4(Adder_s[7:4], Adder_c[6:4], CarryOut1);    AdderOp[11:8] = Sum4(Adder_s[11:8], Adder_c[10:8], CarryOut2);    AdderOp[15:12] = Sum4(Adder_s[15:12], Adder_c[14:12], CarryOut3);endendmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -