aboutsummaryrefslogtreecommitdiff
path: root/src/rtl/shl32.v
diff options
context:
space:
mode:
Diffstat (limited to 'src/rtl/shl32.v')
-rw-r--r--src/rtl/shl32.v31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/rtl/shl32.v b/src/rtl/shl32.v
index 42521fd..bed83e8 100644
--- a/src/rtl/shl32.v
+++ b/src/rtl/shl32.v
@@ -1,11 +1,12 @@
//======================================================================
//
-// shl32.v
-// -------
-// 32bit left shift with carry in / carry out
+// shl.v
+// -----
+// One bit left shift of words with carry in and carry out. Used in
+// the residue module of the modexp core.
//
//
-// Author: Peter Magnusson
+// Author: Peter Magnusson, Joachim Strömbergson
// Copyright (c) 2015, NORDUnet A/S All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -36,18 +37,20 @@
//
//======================================================================
-module shl32(
- input wire [31 : 0] a,
- input wire carry_in,
- output wire [31 : 0] amul2,
- output wire carry_out
- );
+module shl #(parameter OPW = 32)
+ (
+ input wire [(OPW - 1) : 0] a,
+ input wire carry_in,
- assign amul2 = {a[30 : 0], carry_in};
- assign carry_out = a[31];
+ output wire [(OPW - 1) : 0] amul2,
+ output wire carry_out
+ );
-endmodule // shl32
+ assign amul2 = {a[(OPW - 2) : 0], carry_in};
+ assign carry_out = a[(OPW - 1)];
+
+endmodule // shl
//======================================================================
-// EOF shl32.v
+// EOF shl.v
//======================================================================