mult4x4_s.v
来自「本人正在学习vhdl语言」· Verilog 代码 · 共 45 行
V
45 行
//
// Module: MULT4X4_S
//
// Description: Verilog Sub-module
// 4-bit X 4-bit embedded signed multiplier (asynchronous)
//
// Device: Virtex-II Family
//
// Copyright (c) 2000 Xilinx, Inc. All rights reserved.
//
////////////////////////////////////////////////////////////////////////////////////
//
/**************************************
Theory for 4x4 bit multiplier
using lsb inputs, outputs
[10'b0][a{3,3,3,3}][a{3:0}]
x [10'b0][b{3,3,3,3}][b{3:0}]
---------------------------------
*************************************/
module MULT4X4_S (A,B,P);
input [3:0] A;
input [3:0] B;
output [7:0] P;
wire [35:0] Product;
//
// Instantiation Section
//
MULT18X18 U_MULT4X4_S
(
.A ({10'b0, A[3], A[3], A[3], A[3], A[3:0]}) ,
.B ({10'b0, B[3], B[3], B[3], B[3], B[3:0]}) ,
.P (Product)
);
assign P = Product[7:0];
//
////////////////////////////////////////////////////////////////////////////////////
endmodule
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?