Page MenuHomePhorge

substractor64.v
No OneTemporary

Size
797 B
Referenced Files
None
Subscribers
None

substractor64.v

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

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)

Event Timeline