Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F630532
substractor64.v
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Size
797 B
Referenced Files
None
Subscribers
None
substractor64.v
View Options
module
substractor64
#(
parameter
BITWIDTH
=
64
)
(
A
,
B
,
Ci
,
S
,
Co
);
// Input and Output Declarations
input
[
BITWIDTH
-
1
:
0
]
A
;
// A is an input of size BITWIDTH
input
[
BITWIDTH
-
1
:
0
]
B
;
// B is an input of size BITWIDTH
input
Ci
;
// Carry-in (used for borrow)
output
[
BITWIDTH
-
1
:
0
]
S
;
// S is an output of size BITWIDTH
output
Co
;
// Carry-out (borrow-out)
// Internal Wire Declaration
wire
[
BITWIDTH:
0
]
Diff
;
// Difference wire (one extra bit for borrow)
// Assign Statements for Subtraction
assign
Diff
=
A
-
B
-
Ci
;
// Calculate the difference
assign
S
=
Diff
[
BITWIDTH
-
1
:
0
];
// Assign the lower BITWIDTH bits to S
assign
Co
=
Diff
[
BITWIDTH
];
// Assign the borrow-out
endmodule
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 16, 3:05 AM (2 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
253548
Default Alt Text
substractor64.v (797 B)
Attached To
Mode
R231 SoC_I-Edge_yosys_nem_optimization
Attached
Detach File
Event Timeline
Log In to Comment