overflow fix

This commit is contained in:
k0rrluna 2024-12-21 15:36:58 +03:00
parent 4363a50662
commit 9102d27bab
9 changed files with 1703 additions and 2851 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@ fulladder f2(.A(A[2]), .B(B[2]), .Carry(Carry4[1]), .Sum(Y[2]), .CarryO(Carry4[2
fulladder f3(.A(A[3]), .B(B[3]), .Carry(Carry4[2]), .Sum(Y[3]), .CarryO(CarryOUT));
overflowDetect od1 (.opCode(2'b01), .A(A), .B(B), .Y(Y), .CarryOUT(CarryOUT), .overflowDetect(overflow));
//overflowDetect od1 (.opCode(2'b01), .A(A), .B(B), .Y(Y), .CarryOUT(CarryOUT), .overflowDetect(overflow));
xor ov1 (overflow, Carry4[2], CarryOUT);
endmodule

View File

@ -8,10 +8,10 @@ module arithmeticUnit (
);
wire [3:0] addY, subY;
wire overflowSUB, overflowADD, CarryOUTADD, CarryOUTSUB;
wire overflowADD, CarryOUTADD, CarryOUTSUB;
addition a1(.A(A), .B(B), .CarryIN(CarryIN), .Y(addY), .CarryOUT(CarryOUTADD), .overflow(overflowADD));
subtraction s1(.A(A), .B(B), .CarryIN(CarryIN), .Y(subY), .CarryOUT(CarryOUTSUB), .overflow(overflowSUB));
subtraction s1(.A(A), .B(B), .BorrowIN(CarryIN), .Y(subY), .BorrowOUT(CarryOUTSUB));
and add1 (add_Y[0], opCode[0], addY[0]);
and add2 (add_Y[1], opCode[0], addY[1]);
@ -24,6 +24,6 @@ and sub3 (sub_Y[2], opCode[1], subY[2]);
and sub4 (sub_Y[3], opCode[1], subY[3]);
or or1 (CarryOUT, CarryOUTADD, CarryOUTSUB);
or or2 (overflow, overflowADD, overflowSUB);
or or2 (overflow, overflowADD, CarryOUTSUB);
endmodule

View File

@ -7,15 +7,15 @@
:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/vhdl_textio.vpi";
:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/v2005_math.vpi";
:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/va_math.vpi";
S_0x55fdbe99f210 .scope module, "subtractionTB" "subtractionTB" 2 1;
S_0x5632f8d4bad0 .scope module, "subtractionTB" "subtractionTB" 2 1;
.timescale 0 0;
v0x55fdbe9cae90_0 .var "A", 3 0;
v0x55fdbe9cafc0_0 .var "B", 3 0;
v0x55fdbe9cb0d0_0 .var "BorrowIN", 0 0;
v0x55fdbe9cb170_0 .net "BorrowOut", 0 0, L_0x55fdbe9cd610; 1 drivers
v0x55fdbe9cb210_0 .net "Y", 3 0, L_0x55fdbe9cdb40; 1 drivers
v0x55fdbe9cb350_0 .net "overflow", 0 0, L_0x55fdbe9ceb90; 1 drivers
S_0x55fdbe99f550 .scope module, "uut" "subtraction" 2 10, 3 1 0, S_0x55fdbe99f210;
v0x5632f8d77810_0 .var "A", 3 0;
v0x5632f8d77940_0 .var "B", 3 0;
v0x5632f8d77a50_0 .var "BorrowIN", 0 0;
v0x5632f8d77af0_0 .net "BorrowOut", 0 0, L_0x5632f8d79f90; 1 drivers
v0x5632f8d77b90_0 .net "Y", 3 0, L_0x5632f8d7a4c0; 1 drivers
v0x5632f8d77cd0_0 .net "overflow", 0 0, L_0x5632f8d7b470; 1 drivers
S_0x5632f8d362e0 .scope module, "uut" "subtraction" 2 10, 3 1 0, S_0x5632f8d4bad0;
.timescale 0 0;
.port_info 0 /INPUT 4 "A";
.port_info 1 /INPUT 4 "B";
@ -23,205 +23,205 @@ S_0x55fdbe99f550 .scope module, "uut" "subtraction" 2 10, 3 1 0, S_0x55fdbe99f21
.port_info 3 /OUTPUT 4 "Y";
.port_info 4 /OUTPUT 1 "BorrowOut";
.port_info 5 /OUTPUT 1 "overflow";
v0x55fdbe9ca770_0 .net "A", 3 0, v0x55fdbe9cae90_0; 1 drivers
v0x55fdbe9ca850_0 .net "B", 3 0, v0x55fdbe9cafc0_0; 1 drivers
v0x55fdbe9ca920_0 .net "BorrowIN", 0 0, v0x55fdbe9cb0d0_0; 1 drivers
v0x55fdbe9ca9f0_0 .net "BorrowOut", 0 0, L_0x55fdbe9cd610; alias, 1 drivers
v0x55fdbe9caae0_0 .net "Y", 3 0, L_0x55fdbe9cdb40; alias, 1 drivers
o0x7f3602c5f6c8 .functor BUFZ 1, C4<z>; HiZ drive
; Elide local net with no drivers, v0x55fdbe9cabd0_0 name=_ivl_41
v0x55fdbe9cac70_0 .net "overflow", 0 0, L_0x55fdbe9ceb90; alias, 1 drivers
v0x55fdbe9cad10_0 .net "tempB", 3 0, L_0x55fdbe9ceca0; 1 drivers
L_0x55fdbe9cba50 .part v0x55fdbe9cae90_0, 0, 1;
L_0x55fdbe9cbba0 .part v0x55fdbe9cafc0_0, 0, 1;
L_0x55fdbe9cc2e0 .part v0x55fdbe9cae90_0, 1, 1;
L_0x55fdbe9cc4a0 .part v0x55fdbe9cafc0_0, 1, 1;
L_0x55fdbe9cc660 .part L_0x55fdbe9ceca0, 0, 1;
L_0x55fdbe9ccc70 .part v0x55fdbe9cae90_0, 2, 1;
L_0x55fdbe9ccde0 .part v0x55fdbe9cafc0_0, 2, 1;
L_0x55fdbe9ccf10 .part L_0x55fdbe9ceca0, 1, 1;
L_0x55fdbe9cd750 .part v0x55fdbe9cae90_0, 3, 1;
L_0x55fdbe9cd880 .part v0x55fdbe9cafc0_0, 3, 1;
L_0x55fdbe9cda10 .part L_0x55fdbe9ceca0, 2, 1;
L_0x55fdbe9cdb40 .concat8 [ 1 1 1 1], L_0x55fdbe9cb730, L_0x55fdbe9cbf20, L_0x55fdbe9cc900, L_0x55fdbe9cd2e0;
L_0x55fdbe9ceca0 .concat [ 1 1 1 1], L_0x55fdbe9cb9c0, L_0x55fdbe9cc250, L_0x55fdbe9ccbe0, o0x7f3602c5f6c8;
S_0x55fdbe98a330 .scope module, "f0" "fullsubtraction" 3 12, 4 1 0, S_0x55fdbe99f550;
v0x5632f8d770f0_0 .net "A", 3 0, v0x5632f8d77810_0; 1 drivers
v0x5632f8d771d0_0 .net "B", 3 0, v0x5632f8d77940_0; 1 drivers
v0x5632f8d772a0_0 .net "BorrowIN", 0 0, v0x5632f8d77a50_0; 1 drivers
v0x5632f8d77370_0 .net "BorrowOut", 0 0, L_0x5632f8d79f90; alias, 1 drivers
v0x5632f8d77460_0 .net "Y", 3 0, L_0x5632f8d7a4c0; alias, 1 drivers
o0x7fdc7e0fb6c8 .functor BUFZ 1, C4<z>; HiZ drive
; Elide local net with no drivers, v0x5632f8d77550_0 name=_ivl_41
v0x5632f8d775f0_0 .net "overflow", 0 0, L_0x5632f8d7b470; alias, 1 drivers
v0x5632f8d77690_0 .net "tempB", 3 0, L_0x5632f8d7b580; 1 drivers
L_0x5632f8d783d0 .part v0x5632f8d77810_0, 0, 1;
L_0x5632f8d78520 .part v0x5632f8d77940_0, 0, 1;
L_0x5632f8d78c60 .part v0x5632f8d77810_0, 1, 1;
L_0x5632f8d78e20 .part v0x5632f8d77940_0, 1, 1;
L_0x5632f8d78fe0 .part L_0x5632f8d7b580, 0, 1;
L_0x5632f8d795f0 .part v0x5632f8d77810_0, 2, 1;
L_0x5632f8d79760 .part v0x5632f8d77940_0, 2, 1;
L_0x5632f8d79890 .part L_0x5632f8d7b580, 1, 1;
L_0x5632f8d7a0d0 .part v0x5632f8d77810_0, 3, 1;
L_0x5632f8d7a200 .part v0x5632f8d77940_0, 3, 1;
L_0x5632f8d7a390 .part L_0x5632f8d7b580, 2, 1;
L_0x5632f8d7a4c0 .concat8 [ 1 1 1 1], L_0x5632f8d780b0, L_0x5632f8d788a0, L_0x5632f8d79280, L_0x5632f8d79c60;
L_0x5632f8d7b580 .concat [ 1 1 1 1], L_0x5632f8d78340, L_0x5632f8d78bd0, L_0x5632f8d79560, o0x7fdc7e0fb6c8;
S_0x5632f8d4a0f0 .scope module, "f0" "fullsubtraction" 3 12, 4 1 0, S_0x5632f8d362e0;
.timescale 0 0;
.port_info 0 /INPUT 1 "A";
.port_info 1 /INPUT 1 "B";
.port_info 2 /INPUT 1 "BorrowIN";
.port_info 3 /OUTPUT 1 "Difference";
.port_info 4 /OUTPUT 1 "BorrowOut";
L_0x55fdbe9cb9c0 .functor OR 1, L_0x55fdbe9cb620, L_0x55fdbe9cb950, C4<0>, C4<0>;
v0x55fdbe9c4400_0 .net "A", 0 0, L_0x55fdbe9cba50; 1 drivers
v0x55fdbe9c44c0_0 .net "B", 0 0, L_0x55fdbe9cbba0; 1 drivers
v0x55fdbe9c4590_0 .net "BorrowIN", 0 0, v0x55fdbe9cb0d0_0; alias, 1 drivers
v0x55fdbe9c4690_0 .net "BorrowOut", 0 0, L_0x55fdbe9cb9c0; 1 drivers
v0x55fdbe9c4730_0 .net "Difference", 0 0, L_0x55fdbe9cb730; 1 drivers
v0x55fdbe9c4820_0 .net "tempB1", 0 0, L_0x55fdbe9cb620; 1 drivers
v0x55fdbe9c48f0_0 .net "tempB2", 0 0, L_0x55fdbe9cb950; 1 drivers
v0x55fdbe9c49c0_0 .net "tempD", 0 0, L_0x55fdbe9cb440; 1 drivers
S_0x55fdbe996d90 .scope module, "hf1" "halfsubtraction" 4 8, 5 1 0, S_0x55fdbe98a330;
L_0x5632f8d78340 .functor OR 1, L_0x5632f8d77fa0, L_0x5632f8d782d0, C4<0>, C4<0>;
v0x5632f8d70d80_0 .net "A", 0 0, L_0x5632f8d783d0; 1 drivers
v0x5632f8d70e40_0 .net "B", 0 0, L_0x5632f8d78520; 1 drivers
v0x5632f8d70f10_0 .net "BorrowIN", 0 0, v0x5632f8d77a50_0; alias, 1 drivers
v0x5632f8d71010_0 .net "BorrowOut", 0 0, L_0x5632f8d78340; 1 drivers
v0x5632f8d710b0_0 .net "Difference", 0 0, L_0x5632f8d780b0; 1 drivers
v0x5632f8d711a0_0 .net "tempB1", 0 0, L_0x5632f8d77fa0; 1 drivers
v0x5632f8d71270_0 .net "tempB2", 0 0, L_0x5632f8d782d0; 1 drivers
v0x5632f8d71340_0 .net "tempD", 0 0, L_0x5632f8d77dc0; 1 drivers
S_0x5632f8d430f0 .scope module, "hf1" "halfsubtraction" 4 8, 5 1 0, S_0x5632f8d4a0f0;
.timescale 0 0;
.port_info 0 /INPUT 1 "A";
.port_info 1 /INPUT 1 "B";
.port_info 2 /OUTPUT 1 "Difference";
.port_info 3 /OUTPUT 1 "Borrow";
L_0x55fdbe9cb440 .functor XOR 1, L_0x55fdbe9cba50, L_0x55fdbe9cbba0, C4<0>, C4<0>;
L_0x55fdbe9cb590 .functor NOT 1, L_0x55fdbe9cba50, C4<0>, C4<0>, C4<0>;
L_0x55fdbe9cb620 .functor AND 1, L_0x55fdbe9cb590, L_0x55fdbe9cbba0, C4<1>, C4<1>;
v0x55fdbe99fb80_0 .net "A", 0 0, L_0x55fdbe9cba50; alias, 1 drivers
v0x55fdbe98c6e0_0 .net "B", 0 0, L_0x55fdbe9cbba0; alias, 1 drivers
v0x55fdbe98a9d0_0 .net "Borrow", 0 0, L_0x55fdbe9cb620; alias, 1 drivers
v0x55fdbe9c3b10_0 .net "Difference", 0 0, L_0x55fdbe9cb440; alias, 1 drivers
v0x55fdbe9c3bd0_0 .net "notA", 0 0, L_0x55fdbe9cb590; 1 drivers
S_0x55fdbe9c3d60 .scope module, "hf2" "halfsubtraction" 4 9, 5 1 0, S_0x55fdbe98a330;
L_0x5632f8d77dc0 .functor XOR 1, L_0x5632f8d783d0, L_0x5632f8d78520, C4<0>, C4<0>;
L_0x5632f8d77f10 .functor NOT 1, L_0x5632f8d783d0, C4<0>, C4<0>, C4<0>;
L_0x5632f8d77fa0 .functor AND 1, L_0x5632f8d77f10, L_0x5632f8d78520, C4<1>, C4<1>;
v0x5632f8d4c0e0_0 .net "A", 0 0, L_0x5632f8d783d0; alias, 1 drivers
v0x5632f8d38690_0 .net "B", 0 0, L_0x5632f8d78520; alias, 1 drivers
v0x5632f8d36980_0 .net "Borrow", 0 0, L_0x5632f8d77fa0; alias, 1 drivers
v0x5632f8d70490_0 .net "Difference", 0 0, L_0x5632f8d77dc0; alias, 1 drivers
v0x5632f8d70550_0 .net "notA", 0 0, L_0x5632f8d77f10; 1 drivers
S_0x5632f8d706e0 .scope module, "hf2" "halfsubtraction" 4 9, 5 1 0, S_0x5632f8d4a0f0;
.timescale 0 0;
.port_info 0 /INPUT 1 "A";
.port_info 1 /INPUT 1 "B";
.port_info 2 /OUTPUT 1 "Difference";
.port_info 3 /OUTPUT 1 "Borrow";
L_0x55fdbe9cb730 .functor XOR 1, L_0x55fdbe9cb440, v0x55fdbe9cb0d0_0, C4<0>, C4<0>;
L_0x55fdbe9cb8c0 .functor NOT 1, L_0x55fdbe9cb440, C4<0>, C4<0>, C4<0>;
L_0x55fdbe9cb950 .functor AND 1, L_0x55fdbe9cb8c0, v0x55fdbe9cb0d0_0, C4<1>, C4<1>;
v0x55fdbe9c3fd0_0 .net "A", 0 0, L_0x55fdbe9cb440; alias, 1 drivers
v0x55fdbe9c4070_0 .net "B", 0 0, v0x55fdbe9cb0d0_0; alias, 1 drivers
v0x55fdbe9c4110_0 .net "Borrow", 0 0, L_0x55fdbe9cb950; alias, 1 drivers
v0x55fdbe9c41b0_0 .net "Difference", 0 0, L_0x55fdbe9cb730; alias, 1 drivers
v0x55fdbe9c4270_0 .net "notA", 0 0, L_0x55fdbe9cb8c0; 1 drivers
S_0x55fdbe9c4ab0 .scope module, "f1" "fullsubtraction" 3 13, 4 1 0, S_0x55fdbe99f550;
L_0x5632f8d780b0 .functor XOR 1, L_0x5632f8d77dc0, v0x5632f8d77a50_0, C4<0>, C4<0>;
L_0x5632f8d78240 .functor NOT 1, L_0x5632f8d77dc0, C4<0>, C4<0>, C4<0>;
L_0x5632f8d782d0 .functor AND 1, L_0x5632f8d78240, v0x5632f8d77a50_0, C4<1>, C4<1>;
v0x5632f8d70950_0 .net "A", 0 0, L_0x5632f8d77dc0; alias, 1 drivers
v0x5632f8d709f0_0 .net "B", 0 0, v0x5632f8d77a50_0; alias, 1 drivers
v0x5632f8d70a90_0 .net "Borrow", 0 0, L_0x5632f8d782d0; alias, 1 drivers
v0x5632f8d70b30_0 .net "Difference", 0 0, L_0x5632f8d780b0; alias, 1 drivers
v0x5632f8d70bf0_0 .net "notA", 0 0, L_0x5632f8d78240; 1 drivers
S_0x5632f8d71430 .scope module, "f1" "fullsubtraction" 3 13, 4 1 0, S_0x5632f8d362e0;
.timescale 0 0;
.port_info 0 /INPUT 1 "A";
.port_info 1 /INPUT 1 "B";
.port_info 2 /INPUT 1 "BorrowIN";
.port_info 3 /OUTPUT 1 "Difference";
.port_info 4 /OUTPUT 1 "BorrowOut";
L_0x55fdbe9cc250 .functor OR 1, L_0x55fdbe9cbe10, L_0x55fdbe9cc140, C4<0>, C4<0>;
v0x55fdbe9c5ad0_0 .net "A", 0 0, L_0x55fdbe9cc2e0; 1 drivers
v0x55fdbe9c5b90_0 .net "B", 0 0, L_0x55fdbe9cc4a0; 1 drivers
v0x55fdbe9c5c60_0 .net "BorrowIN", 0 0, L_0x55fdbe9cc660; 1 drivers
v0x55fdbe9c5d60_0 .net "BorrowOut", 0 0, L_0x55fdbe9cc250; 1 drivers
v0x55fdbe9c5e00_0 .net "Difference", 0 0, L_0x55fdbe9cbf20; 1 drivers
v0x55fdbe9c5ef0_0 .net "tempB1", 0 0, L_0x55fdbe9cbe10; 1 drivers
v0x55fdbe9c5fc0_0 .net "tempB2", 0 0, L_0x55fdbe9cc140; 1 drivers
v0x55fdbe9c6090_0 .net "tempD", 0 0, L_0x55fdbe9cbcd0; 1 drivers
S_0x55fdbe9c4c90 .scope module, "hf1" "halfsubtraction" 4 8, 5 1 0, S_0x55fdbe9c4ab0;
L_0x5632f8d78bd0 .functor OR 1, L_0x5632f8d78790, L_0x5632f8d78ac0, C4<0>, C4<0>;
v0x5632f8d72450_0 .net "A", 0 0, L_0x5632f8d78c60; 1 drivers
v0x5632f8d72510_0 .net "B", 0 0, L_0x5632f8d78e20; 1 drivers
v0x5632f8d725e0_0 .net "BorrowIN", 0 0, L_0x5632f8d78fe0; 1 drivers
v0x5632f8d726e0_0 .net "BorrowOut", 0 0, L_0x5632f8d78bd0; 1 drivers
v0x5632f8d72780_0 .net "Difference", 0 0, L_0x5632f8d788a0; 1 drivers
v0x5632f8d72870_0 .net "tempB1", 0 0, L_0x5632f8d78790; 1 drivers
v0x5632f8d72940_0 .net "tempB2", 0 0, L_0x5632f8d78ac0; 1 drivers
v0x5632f8d72a10_0 .net "tempD", 0 0, L_0x5632f8d78650; 1 drivers
S_0x5632f8d71610 .scope module, "hf1" "halfsubtraction" 4 8, 5 1 0, S_0x5632f8d71430;
.timescale 0 0;
.port_info 0 /INPUT 1 "A";
.port_info 1 /INPUT 1 "B";
.port_info 2 /OUTPUT 1 "Difference";
.port_info 3 /OUTPUT 1 "Borrow";
L_0x55fdbe9cbcd0 .functor XOR 1, L_0x55fdbe9cc2e0, L_0x55fdbe9cc4a0, C4<0>, C4<0>;
L_0x55fdbe9cbd80 .functor NOT 1, L_0x55fdbe9cc2e0, C4<0>, C4<0>, C4<0>;
L_0x55fdbe9cbe10 .functor AND 1, L_0x55fdbe9cbd80, L_0x55fdbe9cc4a0, C4<1>, C4<1>;
v0x55fdbe9c4f10_0 .net "A", 0 0, L_0x55fdbe9cc2e0; alias, 1 drivers
v0x55fdbe9c4ff0_0 .net "B", 0 0, L_0x55fdbe9cc4a0; alias, 1 drivers
v0x55fdbe9c50b0_0 .net "Borrow", 0 0, L_0x55fdbe9cbe10; alias, 1 drivers
v0x55fdbe9c5180_0 .net "Difference", 0 0, L_0x55fdbe9cbcd0; alias, 1 drivers
v0x55fdbe9c5240_0 .net "notA", 0 0, L_0x55fdbe9cbd80; 1 drivers
S_0x55fdbe9c53d0 .scope module, "hf2" "halfsubtraction" 4 9, 5 1 0, S_0x55fdbe9c4ab0;
L_0x5632f8d78650 .functor XOR 1, L_0x5632f8d78c60, L_0x5632f8d78e20, C4<0>, C4<0>;
L_0x5632f8d78700 .functor NOT 1, L_0x5632f8d78c60, C4<0>, C4<0>, C4<0>;
L_0x5632f8d78790 .functor AND 1, L_0x5632f8d78700, L_0x5632f8d78e20, C4<1>, C4<1>;
v0x5632f8d71890_0 .net "A", 0 0, L_0x5632f8d78c60; alias, 1 drivers
v0x5632f8d71970_0 .net "B", 0 0, L_0x5632f8d78e20; alias, 1 drivers
v0x5632f8d71a30_0 .net "Borrow", 0 0, L_0x5632f8d78790; alias, 1 drivers
v0x5632f8d71b00_0 .net "Difference", 0 0, L_0x5632f8d78650; alias, 1 drivers
v0x5632f8d71bc0_0 .net "notA", 0 0, L_0x5632f8d78700; 1 drivers
S_0x5632f8d71d50 .scope module, "hf2" "halfsubtraction" 4 9, 5 1 0, S_0x5632f8d71430;
.timescale 0 0;
.port_info 0 /INPUT 1 "A";
.port_info 1 /INPUT 1 "B";
.port_info 2 /OUTPUT 1 "Difference";
.port_info 3 /OUTPUT 1 "Borrow";
L_0x55fdbe9cbf20 .functor XOR 1, L_0x55fdbe9cbcd0, L_0x55fdbe9cc660, C4<0>, C4<0>;
L_0x55fdbe9cc0b0 .functor NOT 1, L_0x55fdbe9cbcd0, C4<0>, C4<0>, C4<0>;
L_0x55fdbe9cc140 .functor AND 1, L_0x55fdbe9cc0b0, L_0x55fdbe9cc660, C4<1>, C4<1>;
v0x55fdbe9c5640_0 .net "A", 0 0, L_0x55fdbe9cbcd0; alias, 1 drivers
v0x55fdbe9c5710_0 .net "B", 0 0, L_0x55fdbe9cc660; alias, 1 drivers
v0x55fdbe9c57b0_0 .net "Borrow", 0 0, L_0x55fdbe9cc140; alias, 1 drivers
v0x55fdbe9c5880_0 .net "Difference", 0 0, L_0x55fdbe9cbf20; alias, 1 drivers
v0x55fdbe9c5940_0 .net "notA", 0 0, L_0x55fdbe9cc0b0; 1 drivers
S_0x55fdbe9c6180 .scope module, "f2" "fullsubtraction" 3 14, 4 1 0, S_0x55fdbe99f550;
L_0x5632f8d788a0 .functor XOR 1, L_0x5632f8d78650, L_0x5632f8d78fe0, C4<0>, C4<0>;
L_0x5632f8d78a30 .functor NOT 1, L_0x5632f8d78650, C4<0>, C4<0>, C4<0>;
L_0x5632f8d78ac0 .functor AND 1, L_0x5632f8d78a30, L_0x5632f8d78fe0, C4<1>, C4<1>;
v0x5632f8d71fc0_0 .net "A", 0 0, L_0x5632f8d78650; alias, 1 drivers
v0x5632f8d72090_0 .net "B", 0 0, L_0x5632f8d78fe0; alias, 1 drivers
v0x5632f8d72130_0 .net "Borrow", 0 0, L_0x5632f8d78ac0; alias, 1 drivers
v0x5632f8d72200_0 .net "Difference", 0 0, L_0x5632f8d788a0; alias, 1 drivers
v0x5632f8d722c0_0 .net "notA", 0 0, L_0x5632f8d78a30; 1 drivers
S_0x5632f8d72b00 .scope module, "f2" "fullsubtraction" 3 14, 4 1 0, S_0x5632f8d362e0;
.timescale 0 0;
.port_info 0 /INPUT 1 "A";
.port_info 1 /INPUT 1 "B";
.port_info 2 /INPUT 1 "BorrowIN";
.port_info 3 /OUTPUT 1 "Difference";
.port_info 4 /OUTPUT 1 "BorrowOut";
L_0x55fdbe9ccbe0 .functor OR 1, L_0x55fdbe9cc890, L_0x55fdbe9ccad0, C4<0>, C4<0>;
v0x55fdbe9c7230_0 .net "A", 0 0, L_0x55fdbe9ccc70; 1 drivers
v0x55fdbe9c72f0_0 .net "B", 0 0, L_0x55fdbe9ccde0; 1 drivers
v0x55fdbe9c73c0_0 .net "BorrowIN", 0 0, L_0x55fdbe9ccf10; 1 drivers
v0x55fdbe9c74c0_0 .net "BorrowOut", 0 0, L_0x55fdbe9ccbe0; 1 drivers
v0x55fdbe9c7560_0 .net "Difference", 0 0, L_0x55fdbe9cc900; 1 drivers
v0x55fdbe9c7650_0 .net "tempB1", 0 0, L_0x55fdbe9cc890; 1 drivers
v0x55fdbe9c7720_0 .net "tempB2", 0 0, L_0x55fdbe9ccad0; 1 drivers
v0x55fdbe9c77f0_0 .net "tempD", 0 0, L_0x55fdbe9cc790; 1 drivers
S_0x55fdbe9c6410 .scope module, "hf1" "halfsubtraction" 4 8, 5 1 0, S_0x55fdbe9c6180;
L_0x5632f8d79560 .functor OR 1, L_0x5632f8d79210, L_0x5632f8d79450, C4<0>, C4<0>;
v0x5632f8d73bb0_0 .net "A", 0 0, L_0x5632f8d795f0; 1 drivers
v0x5632f8d73c70_0 .net "B", 0 0, L_0x5632f8d79760; 1 drivers
v0x5632f8d73d40_0 .net "BorrowIN", 0 0, L_0x5632f8d79890; 1 drivers
v0x5632f8d73e40_0 .net "BorrowOut", 0 0, L_0x5632f8d79560; 1 drivers
v0x5632f8d73ee0_0 .net "Difference", 0 0, L_0x5632f8d79280; 1 drivers
v0x5632f8d73fd0_0 .net "tempB1", 0 0, L_0x5632f8d79210; 1 drivers
v0x5632f8d740a0_0 .net "tempB2", 0 0, L_0x5632f8d79450; 1 drivers
v0x5632f8d74170_0 .net "tempD", 0 0, L_0x5632f8d79110; 1 drivers
S_0x5632f8d72d90 .scope module, "hf1" "halfsubtraction" 4 8, 5 1 0, S_0x5632f8d72b00;
.timescale 0 0;
.port_info 0 /INPUT 1 "A";
.port_info 1 /INPUT 1 "B";
.port_info 2 /OUTPUT 1 "Difference";
.port_info 3 /OUTPUT 1 "Borrow";
L_0x55fdbe9cc790 .functor XOR 1, L_0x55fdbe9ccc70, L_0x55fdbe9ccde0, C4<0>, C4<0>;
L_0x55fdbe9cc800 .functor NOT 1, L_0x55fdbe9ccc70, C4<0>, C4<0>, C4<0>;
L_0x55fdbe9cc890 .functor AND 1, L_0x55fdbe9cc800, L_0x55fdbe9ccde0, C4<1>, C4<1>;
v0x55fdbe9c6690_0 .net "A", 0 0, L_0x55fdbe9ccc70; alias, 1 drivers
v0x55fdbe9c6750_0 .net "B", 0 0, L_0x55fdbe9ccde0; alias, 1 drivers
v0x55fdbe9c6810_0 .net "Borrow", 0 0, L_0x55fdbe9cc890; alias, 1 drivers
v0x55fdbe9c68e0_0 .net "Difference", 0 0, L_0x55fdbe9cc790; alias, 1 drivers
v0x55fdbe9c69a0_0 .net "notA", 0 0, L_0x55fdbe9cc800; 1 drivers
S_0x55fdbe9c6b30 .scope module, "hf2" "halfsubtraction" 4 9, 5 1 0, S_0x55fdbe9c6180;
L_0x5632f8d79110 .functor XOR 1, L_0x5632f8d795f0, L_0x5632f8d79760, C4<0>, C4<0>;
L_0x5632f8d79180 .functor NOT 1, L_0x5632f8d795f0, C4<0>, C4<0>, C4<0>;
L_0x5632f8d79210 .functor AND 1, L_0x5632f8d79180, L_0x5632f8d79760, C4<1>, C4<1>;
v0x5632f8d73010_0 .net "A", 0 0, L_0x5632f8d795f0; alias, 1 drivers
v0x5632f8d730d0_0 .net "B", 0 0, L_0x5632f8d79760; alias, 1 drivers
v0x5632f8d73190_0 .net "Borrow", 0 0, L_0x5632f8d79210; alias, 1 drivers
v0x5632f8d73260_0 .net "Difference", 0 0, L_0x5632f8d79110; alias, 1 drivers
v0x5632f8d73320_0 .net "notA", 0 0, L_0x5632f8d79180; 1 drivers
S_0x5632f8d734b0 .scope module, "hf2" "halfsubtraction" 4 9, 5 1 0, S_0x5632f8d72b00;
.timescale 0 0;
.port_info 0 /INPUT 1 "A";
.port_info 1 /INPUT 1 "B";
.port_info 2 /OUTPUT 1 "Difference";
.port_info 3 /OUTPUT 1 "Borrow";
L_0x55fdbe9cc900 .functor XOR 1, L_0x55fdbe9cc790, L_0x55fdbe9ccf10, C4<0>, C4<0>;
L_0x55fdbe9cca40 .functor NOT 1, L_0x55fdbe9cc790, C4<0>, C4<0>, C4<0>;
L_0x55fdbe9ccad0 .functor AND 1, L_0x55fdbe9cca40, L_0x55fdbe9ccf10, C4<1>, C4<1>;
v0x55fdbe9c6da0_0 .net "A", 0 0, L_0x55fdbe9cc790; alias, 1 drivers
v0x55fdbe9c6e70_0 .net "B", 0 0, L_0x55fdbe9ccf10; alias, 1 drivers
v0x55fdbe9c6f10_0 .net "Borrow", 0 0, L_0x55fdbe9ccad0; alias, 1 drivers
v0x55fdbe9c6fe0_0 .net "Difference", 0 0, L_0x55fdbe9cc900; alias, 1 drivers
v0x55fdbe9c70a0_0 .net "notA", 0 0, L_0x55fdbe9cca40; 1 drivers
S_0x55fdbe9c78e0 .scope module, "f3" "fullsubtraction" 3 15, 4 1 0, S_0x55fdbe99f550;
L_0x5632f8d79280 .functor XOR 1, L_0x5632f8d79110, L_0x5632f8d79890, C4<0>, C4<0>;
L_0x5632f8d793c0 .functor NOT 1, L_0x5632f8d79110, C4<0>, C4<0>, C4<0>;
L_0x5632f8d79450 .functor AND 1, L_0x5632f8d793c0, L_0x5632f8d79890, C4<1>, C4<1>;
v0x5632f8d73720_0 .net "A", 0 0, L_0x5632f8d79110; alias, 1 drivers
v0x5632f8d737f0_0 .net "B", 0 0, L_0x5632f8d79890; alias, 1 drivers
v0x5632f8d73890_0 .net "Borrow", 0 0, L_0x5632f8d79450; alias, 1 drivers
v0x5632f8d73960_0 .net "Difference", 0 0, L_0x5632f8d79280; alias, 1 drivers
v0x5632f8d73a20_0 .net "notA", 0 0, L_0x5632f8d793c0; 1 drivers
S_0x5632f8d74260 .scope module, "f3" "fullsubtraction" 3 15, 4 1 0, S_0x5632f8d362e0;
.timescale 0 0;
.port_info 0 /INPUT 1 "A";
.port_info 1 /INPUT 1 "B";
.port_info 2 /INPUT 1 "BorrowIN";
.port_info 3 /OUTPUT 1 "Difference";
.port_info 4 /OUTPUT 1 "BorrowOut";
L_0x55fdbe9cd610 .functor OR 1, L_0x55fdbe9cd1d0, L_0x55fdbe9cd500, C4<0>, C4<0>;
v0x55fdbe9c8980_0 .net "A", 0 0, L_0x55fdbe9cd750; 1 drivers
v0x55fdbe9c8a40_0 .net "B", 0 0, L_0x55fdbe9cd880; 1 drivers
v0x55fdbe9c8b10_0 .net "BorrowIN", 0 0, L_0x55fdbe9cda10; 1 drivers
v0x55fdbe9c8c10_0 .net "BorrowOut", 0 0, L_0x55fdbe9cd610; alias, 1 drivers
v0x55fdbe9c8cb0_0 .net "Difference", 0 0, L_0x55fdbe9cd2e0; 1 drivers
v0x55fdbe9c8da0_0 .net "tempB1", 0 0, L_0x55fdbe9cd1d0; 1 drivers
v0x55fdbe9c8e70_0 .net "tempB2", 0 0, L_0x55fdbe9cd500; 1 drivers
v0x55fdbe9c8f40_0 .net "tempD", 0 0, L_0x55fdbe9cd090; 1 drivers
S_0x55fdbe9c7b40 .scope module, "hf1" "halfsubtraction" 4 8, 5 1 0, S_0x55fdbe9c78e0;
L_0x5632f8d79f90 .functor OR 1, L_0x5632f8d79b50, L_0x5632f8d79e80, C4<0>, C4<0>;
v0x5632f8d75300_0 .net "A", 0 0, L_0x5632f8d7a0d0; 1 drivers
v0x5632f8d753c0_0 .net "B", 0 0, L_0x5632f8d7a200; 1 drivers
v0x5632f8d75490_0 .net "BorrowIN", 0 0, L_0x5632f8d7a390; 1 drivers
v0x5632f8d75590_0 .net "BorrowOut", 0 0, L_0x5632f8d79f90; alias, 1 drivers
v0x5632f8d75630_0 .net "Difference", 0 0, L_0x5632f8d79c60; 1 drivers
v0x5632f8d75720_0 .net "tempB1", 0 0, L_0x5632f8d79b50; 1 drivers
v0x5632f8d757f0_0 .net "tempB2", 0 0, L_0x5632f8d79e80; 1 drivers
v0x5632f8d758c0_0 .net "tempD", 0 0, L_0x5632f8d79a10; 1 drivers
S_0x5632f8d744c0 .scope module, "hf1" "halfsubtraction" 4 8, 5 1 0, S_0x5632f8d74260;
.timescale 0 0;
.port_info 0 /INPUT 1 "A";
.port_info 1 /INPUT 1 "B";
.port_info 2 /OUTPUT 1 "Difference";
.port_info 3 /OUTPUT 1 "Borrow";
L_0x55fdbe9cd090 .functor XOR 1, L_0x55fdbe9cd750, L_0x55fdbe9cd880, C4<0>, C4<0>;
L_0x55fdbe9cd140 .functor NOT 1, L_0x55fdbe9cd750, C4<0>, C4<0>, C4<0>;
L_0x55fdbe9cd1d0 .functor AND 1, L_0x55fdbe9cd140, L_0x55fdbe9cd880, C4<1>, C4<1>;
v0x55fdbe9c7dc0_0 .net "A", 0 0, L_0x55fdbe9cd750; alias, 1 drivers
v0x55fdbe9c7ea0_0 .net "B", 0 0, L_0x55fdbe9cd880; alias, 1 drivers
v0x55fdbe9c7f60_0 .net "Borrow", 0 0, L_0x55fdbe9cd1d0; alias, 1 drivers
v0x55fdbe9c8030_0 .net "Difference", 0 0, L_0x55fdbe9cd090; alias, 1 drivers
v0x55fdbe9c80f0_0 .net "notA", 0 0, L_0x55fdbe9cd140; 1 drivers
S_0x55fdbe9c8280 .scope module, "hf2" "halfsubtraction" 4 9, 5 1 0, S_0x55fdbe9c78e0;
L_0x5632f8d79a10 .functor XOR 1, L_0x5632f8d7a0d0, L_0x5632f8d7a200, C4<0>, C4<0>;
L_0x5632f8d79ac0 .functor NOT 1, L_0x5632f8d7a0d0, C4<0>, C4<0>, C4<0>;
L_0x5632f8d79b50 .functor AND 1, L_0x5632f8d79ac0, L_0x5632f8d7a200, C4<1>, C4<1>;
v0x5632f8d74740_0 .net "A", 0 0, L_0x5632f8d7a0d0; alias, 1 drivers
v0x5632f8d74820_0 .net "B", 0 0, L_0x5632f8d7a200; alias, 1 drivers
v0x5632f8d748e0_0 .net "Borrow", 0 0, L_0x5632f8d79b50; alias, 1 drivers
v0x5632f8d749b0_0 .net "Difference", 0 0, L_0x5632f8d79a10; alias, 1 drivers
v0x5632f8d74a70_0 .net "notA", 0 0, L_0x5632f8d79ac0; 1 drivers
S_0x5632f8d74c00 .scope module, "hf2" "halfsubtraction" 4 9, 5 1 0, S_0x5632f8d74260;
.timescale 0 0;
.port_info 0 /INPUT 1 "A";
.port_info 1 /INPUT 1 "B";
.port_info 2 /OUTPUT 1 "Difference";
.port_info 3 /OUTPUT 1 "Borrow";
L_0x55fdbe9cd2e0 .functor XOR 1, L_0x55fdbe9cd090, L_0x55fdbe9cda10, C4<0>, C4<0>;
L_0x55fdbe9cd470 .functor NOT 1, L_0x55fdbe9cd090, C4<0>, C4<0>, C4<0>;
L_0x55fdbe9cd500 .functor AND 1, L_0x55fdbe9cd470, L_0x55fdbe9cda10, C4<1>, C4<1>;
v0x55fdbe9c84f0_0 .net "A", 0 0, L_0x55fdbe9cd090; alias, 1 drivers
v0x55fdbe9c85c0_0 .net "B", 0 0, L_0x55fdbe9cda10; alias, 1 drivers
v0x55fdbe9c8660_0 .net "Borrow", 0 0, L_0x55fdbe9cd500; alias, 1 drivers
v0x55fdbe9c8730_0 .net "Difference", 0 0, L_0x55fdbe9cd2e0; alias, 1 drivers
v0x55fdbe9c87f0_0 .net "notA", 0 0, L_0x55fdbe9cd470; 1 drivers
S_0x55fdbe9c9030 .scope module, "od1" "overflowDetect" 3 18, 6 1 0, S_0x55fdbe99f550;
L_0x5632f8d79c60 .functor XOR 1, L_0x5632f8d79a10, L_0x5632f8d7a390, C4<0>, C4<0>;
L_0x5632f8d79df0 .functor NOT 1, L_0x5632f8d79a10, C4<0>, C4<0>, C4<0>;
L_0x5632f8d79e80 .functor AND 1, L_0x5632f8d79df0, L_0x5632f8d7a390, C4<1>, C4<1>;
v0x5632f8d74e70_0 .net "A", 0 0, L_0x5632f8d79a10; alias, 1 drivers
v0x5632f8d74f40_0 .net "B", 0 0, L_0x5632f8d7a390; alias, 1 drivers
v0x5632f8d74fe0_0 .net "Borrow", 0 0, L_0x5632f8d79e80; alias, 1 drivers
v0x5632f8d750b0_0 .net "Difference", 0 0, L_0x5632f8d79c60; alias, 1 drivers
v0x5632f8d75170_0 .net "notA", 0 0, L_0x5632f8d79df0; 1 drivers
S_0x5632f8d759b0 .scope module, "od1" "overflowDetect" 3 18, 6 1 0, S_0x5632f8d362e0;
.timescale 0 0;
.port_info 0 /INPUT 2 "opCode";
.port_info 1 /INPUT 4 "A";
@ -229,95 +229,102 @@ S_0x55fdbe9c9030 .scope module, "od1" "overflowDetect" 3 18, 6 1 0, S_0x55fdbe99
.port_info 3 /INPUT 4 "Y";
.port_info 4 /INPUT 1 "CarryOUT";
.port_info 5 /OUTPUT 1 "overflowDetect";
L_0x55fdbe9cdc50 .functor OR 1, L_0x55fdbe9cdce0, L_0x55fdbe9cdd80, C4<0>, C4<0>;
L_0x55fdbe9cde20 .functor XNOR 1, L_0x55fdbe9cde90, L_0x55fdbe9cdf30, C4<0>, C4<0>;
L_0x55fdbe9cdfd0 .functor XOR 1, L_0x55fdbe9ce040, L_0x55fdbe9ce130, C4<0>, C4<0>;
L_0x55fdbe9ce370 .functor XOR 1, L_0x55fdbe9ce3e0, L_0x55fdbe9ce4d0, C4<0>, C4<0>;
L_0x55fdbe9ce5c0 .functor AND 1, L_0x55fdbe9cde20, L_0x55fdbe9ce680, C4<1>, C4<1>;
L_0x55fdbe9ce770 .functor AND 1, L_0x55fdbe9cdfd0, L_0x55fdbe9ce870, C4<1>, C4<1>;
L_0x55fdbe9ce9c0 .functor OR 1, L_0x55fdbe9ce5c0, L_0x55fdbe9ce770, C4<0>, C4<0>;
L_0x55fdbe9cea30 .functor AND 1, L_0x55fdbe9ce9c0, L_0x55fdbe9ce370, C4<1>, C4<1>;
L_0x55fdbe9ceb90 .functor AND 1, L_0x55fdbe9cdc50, L_0x55fdbe9cea30, C4<1>, C4<1>;
v0x55fdbe9c9300_0 .net "A", 3 0, v0x55fdbe9cae90_0; alias, 1 drivers
v0x55fdbe9c93e0_0 .net "B", 3 0, v0x55fdbe9cafc0_0; alias, 1 drivers
v0x55fdbe9c94c0_0 .net "CarryOUT", 0 0, L_0x55fdbe9cd610; alias, 1 drivers
v0x55fdbe9c9560_0 .net "Y", 3 0, L_0x55fdbe9cdb40; alias, 1 drivers
v0x55fdbe9c9600_0 .net *"_ivl_1", 0 0, L_0x55fdbe9cdce0; 1 drivers
v0x55fdbe9c9730_0 .net *"_ivl_11", 0 0, L_0x55fdbe9ce130; 1 drivers
v0x55fdbe9c9810_0 .net *"_ivl_13", 0 0, L_0x55fdbe9ce3e0; 1 drivers
v0x55fdbe9c98f0_0 .net *"_ivl_15", 0 0, L_0x55fdbe9ce4d0; 1 drivers
v0x55fdbe9c99d0_0 .net *"_ivl_17", 0 0, L_0x55fdbe9ce680; 1 drivers
v0x55fdbe9c9ab0_0 .net *"_ivl_19", 0 0, L_0x55fdbe9ce870; 1 drivers
v0x55fdbe9c9b90_0 .net *"_ivl_3", 0 0, L_0x55fdbe9cdd80; 1 drivers
v0x55fdbe9c9c70_0 .net *"_ivl_5", 0 0, L_0x55fdbe9cde90; 1 drivers
v0x55fdbe9c9d50_0 .net *"_ivl_7", 0 0, L_0x55fdbe9cdf30; 1 drivers
v0x55fdbe9c9e30_0 .net *"_ivl_9", 0 0, L_0x55fdbe9ce040; 1 drivers
v0x55fdbe9c9f10_0 .net "addOverflow", 0 0, L_0x55fdbe9ce5c0; 1 drivers
v0x55fdbe9c9fd0_0 .net "detect1", 0 0, L_0x55fdbe9ce9c0; 1 drivers
v0x55fdbe9ca090_0 .net "detect2", 0 0, L_0x55fdbe9cea30; 1 drivers
v0x55fdbe9ca150_0 .net "opC", 0 0, L_0x55fdbe9cdc50; 1 drivers
L_0x7f3602c15018 .functor BUFT 1, C4<10>, C4<0>, C4<0>, C4<0>;
v0x55fdbe9ca210_0 .net "opCode", 1 0, L_0x7f3602c15018; 1 drivers
v0x55fdbe9ca2f0_0 .net "overflowDetect", 0 0, L_0x55fdbe9ceb90; alias, 1 drivers
v0x55fdbe9ca3b0_0 .net "sign1", 0 0, L_0x55fdbe9cde20; 1 drivers
v0x55fdbe9ca470_0 .net "sign2", 0 0, L_0x55fdbe9ce370; 1 drivers
v0x55fdbe9ca530_0 .net "sign3", 0 0, L_0x55fdbe9cdfd0; 1 drivers
v0x55fdbe9ca5f0_0 .net "subOverflow", 0 0, L_0x55fdbe9ce770; 1 drivers
L_0x55fdbe9cdce0 .part L_0x7f3602c15018, 0, 1;
L_0x55fdbe9cdd80 .part L_0x7f3602c15018, 1, 1;
L_0x55fdbe9cde90 .part v0x55fdbe9cae90_0, 3, 1;
L_0x55fdbe9cdf30 .part v0x55fdbe9cafc0_0, 3, 1;
L_0x55fdbe9ce040 .part v0x55fdbe9cae90_0, 3, 1;
L_0x55fdbe9ce130 .part v0x55fdbe9cafc0_0, 3, 1;
L_0x55fdbe9ce3e0 .part L_0x55fdbe9cdb40, 3, 1;
L_0x55fdbe9ce4d0 .part v0x55fdbe9cae90_0, 3, 1;
L_0x55fdbe9ce680 .part L_0x7f3602c15018, 0, 1;
L_0x55fdbe9ce870 .part L_0x7f3602c15018, 1, 1;
.scope S_0x55fdbe99f210;
L_0x5632f8d7a5d0 .functor OR 1, L_0x5632f8d7a660, L_0x5632f8d7a700, C4<0>, C4<0>;
L_0x5632f8d7a7a0 .functor XNOR 1, L_0x5632f8d7a810, L_0x5632f8d7a8b0, C4<0>, C4<0>;
L_0x5632f8d7a950 .functor XOR 1, L_0x5632f8d7a9c0, L_0x5632f8d7aab0, C4<0>, C4<0>;
L_0x5632f8d7acf0 .functor XOR 1, L_0x5632f8d7ad60, L_0x5632f8d7ae50, C4<0>, C4<0>;
L_0x5632f8d7af40 .functor AND 1, L_0x5632f8d7a7a0, L_0x5632f8d7afb0, C4<1>, C4<1>;
L_0x5632f8d7b050 .functor AND 1, L_0x5632f8d7a950, L_0x5632f8d7b150, C4<1>, C4<1>;
L_0x5632f8d7b2a0 .functor OR 1, L_0x5632f8d7af40, L_0x5632f8d7b050, C4<0>, C4<0>;
L_0x5632f8d7b310 .functor AND 1, L_0x5632f8d7b2a0, L_0x5632f8d7acf0, C4<1>, C4<1>;
L_0x5632f8d7b470 .functor AND 1, L_0x5632f8d7a5d0, L_0x5632f8d7b310, C4<1>, C4<1>;
v0x5632f8d75c80_0 .net "A", 3 0, v0x5632f8d77810_0; alias, 1 drivers
v0x5632f8d75d60_0 .net "B", 3 0, v0x5632f8d77940_0; alias, 1 drivers
v0x5632f8d75e40_0 .net "CarryOUT", 0 0, L_0x5632f8d79f90; alias, 1 drivers
v0x5632f8d75ee0_0 .net "Y", 3 0, L_0x5632f8d7a4c0; alias, 1 drivers
v0x5632f8d75f80_0 .net *"_ivl_1", 0 0, L_0x5632f8d7a660; 1 drivers
v0x5632f8d760b0_0 .net *"_ivl_11", 0 0, L_0x5632f8d7aab0; 1 drivers
v0x5632f8d76190_0 .net *"_ivl_13", 0 0, L_0x5632f8d7ad60; 1 drivers
v0x5632f8d76270_0 .net *"_ivl_15", 0 0, L_0x5632f8d7ae50; 1 drivers
v0x5632f8d76350_0 .net *"_ivl_17", 0 0, L_0x5632f8d7afb0; 1 drivers
v0x5632f8d76430_0 .net *"_ivl_19", 0 0, L_0x5632f8d7b150; 1 drivers
v0x5632f8d76510_0 .net *"_ivl_3", 0 0, L_0x5632f8d7a700; 1 drivers
v0x5632f8d765f0_0 .net *"_ivl_5", 0 0, L_0x5632f8d7a810; 1 drivers
v0x5632f8d766d0_0 .net *"_ivl_7", 0 0, L_0x5632f8d7a8b0; 1 drivers
v0x5632f8d767b0_0 .net *"_ivl_9", 0 0, L_0x5632f8d7a9c0; 1 drivers
v0x5632f8d76890_0 .net "addOverflow", 0 0, L_0x5632f8d7af40; 1 drivers
v0x5632f8d76950_0 .net "detect1", 0 0, L_0x5632f8d7b2a0; 1 drivers
v0x5632f8d76a10_0 .net "detect2", 0 0, L_0x5632f8d7b310; 1 drivers
v0x5632f8d76ad0_0 .net "opC", 0 0, L_0x5632f8d7a5d0; 1 drivers
L_0x7fdc7e0b1018 .functor BUFT 1, C4<10>, C4<0>, C4<0>, C4<0>;
v0x5632f8d76b90_0 .net "opCode", 1 0, L_0x7fdc7e0b1018; 1 drivers
v0x5632f8d76c70_0 .net "overflowDetect", 0 0, L_0x5632f8d7b470; alias, 1 drivers
v0x5632f8d76d30_0 .net "sign1", 0 0, L_0x5632f8d7a7a0; 1 drivers
v0x5632f8d76df0_0 .net "sign2", 0 0, L_0x5632f8d7acf0; 1 drivers
v0x5632f8d76eb0_0 .net "sign3", 0 0, L_0x5632f8d7a950; 1 drivers
v0x5632f8d76f70_0 .net "subOverflow", 0 0, L_0x5632f8d7b050; 1 drivers
L_0x5632f8d7a660 .part L_0x7fdc7e0b1018, 0, 1;
L_0x5632f8d7a700 .part L_0x7fdc7e0b1018, 1, 1;
L_0x5632f8d7a810 .part v0x5632f8d77810_0, 3, 1;
L_0x5632f8d7a8b0 .part v0x5632f8d77940_0, 3, 1;
L_0x5632f8d7a9c0 .part v0x5632f8d77810_0, 3, 1;
L_0x5632f8d7aab0 .part v0x5632f8d77940_0, 3, 1;
L_0x5632f8d7ad60 .part L_0x5632f8d7a4c0, 3, 1;
L_0x5632f8d7ae50 .part v0x5632f8d77810_0, 3, 1;
L_0x5632f8d7afb0 .part L_0x7fdc7e0b1018, 0, 1;
L_0x5632f8d7b150 .part L_0x7fdc7e0b1018, 1, 1;
.scope S_0x5632f8d4bad0;
T_0 ;
%vpi_call 2 20 "$dumpfile", "subtraction.vcd" {0 0 0};
%vpi_call 2 21 "$dumpvars" {0 0 0};
%pushi/vec4 0, 0, 4;
%store/vec4 v0x55fdbe9cae90_0, 0, 4;
%store/vec4 v0x5632f8d77810_0, 0, 4;
%pushi/vec4 0, 0, 4;
%store/vec4 v0x55fdbe9cafc0_0, 0, 4;
%store/vec4 v0x5632f8d77940_0, 0, 4;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x55fdbe9cb0d0_0, 0, 1;
%store/vec4 v0x5632f8d77a50_0, 0, 1;
%delay 10, 0;
%pushi/vec4 6, 0, 4;
%store/vec4 v0x55fdbe9cae90_0, 0, 4;
%store/vec4 v0x5632f8d77810_0, 0, 4;
%pushi/vec4 2, 0, 4;
%store/vec4 v0x55fdbe9cafc0_0, 0, 4;
%store/vec4 v0x5632f8d77940_0, 0, 4;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x55fdbe9cb0d0_0, 0, 1;
%store/vec4 v0x5632f8d77a50_0, 0, 1;
%delay 10, 0;
%pushi/vec4 2, 0, 4;
%store/vec4 v0x5632f8d77810_0, 0, 4;
%pushi/vec4 6, 0, 4;
%store/vec4 v0x5632f8d77940_0, 0, 4;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x5632f8d77a50_0, 0, 1;
%delay 10, 0;
%pushi/vec4 12, 0, 4;
%store/vec4 v0x55fdbe9cae90_0, 0, 4;
%store/vec4 v0x5632f8d77810_0, 0, 4;
%pushi/vec4 4, 0, 4;
%store/vec4 v0x55fdbe9cafc0_0, 0, 4;
%store/vec4 v0x5632f8d77940_0, 0, 4;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x55fdbe9cb0d0_0, 0, 1;
%store/vec4 v0x5632f8d77a50_0, 0, 1;
%delay 10, 0;
%pushi/vec4 8, 0, 4;
%store/vec4 v0x55fdbe9cae90_0, 0, 4;
%store/vec4 v0x5632f8d77810_0, 0, 4;
%pushi/vec4 8, 0, 4;
%store/vec4 v0x55fdbe9cafc0_0, 0, 4;
%store/vec4 v0x5632f8d77940_0, 0, 4;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x55fdbe9cb0d0_0, 0, 1;
%store/vec4 v0x5632f8d77a50_0, 0, 1;
%delay 10, 0;
%pushi/vec4 15, 0, 4;
%store/vec4 v0x55fdbe9cae90_0, 0, 4;
%store/vec4 v0x5632f8d77810_0, 0, 4;
%pushi/vec4 1, 0, 4;
%store/vec4 v0x55fdbe9cafc0_0, 0, 4;
%store/vec4 v0x5632f8d77940_0, 0, 4;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x55fdbe9cb0d0_0, 0, 1;
%store/vec4 v0x5632f8d77a50_0, 0, 1;
%delay 10, 0;
%vpi_call 2 34 "$finish" {0 0 0};
%vpi_call 2 35 "$finish" {0 0 0};
%end;
.thread T_0;
.scope S_0x55fdbe99f210;
.scope S_0x5632f8d4bad0;
T_1 ;
%vpi_call 2 39 "$monitor", "At time %t: A = %b, B = %b, Y = %b, BorrowOut = %b, overflow = %b", $time, v0x55fdbe9cae90_0, v0x55fdbe9cafc0_0, v0x55fdbe9cb210_0, v0x55fdbe9cb170_0, v0x55fdbe9cb350_0 {0 0 0};
%vpi_call 2 40 "$monitor", "At time %t: A = %b, B = %b, Y = %b, BorrowOut = %b, overflow = %b", $time, v0x5632f8d77810_0, v0x5632f8d77940_0, v0x5632f8d77b90_0, v0x5632f8d77af0_0, v0x5632f8d77cd0_0 {0 0 0};
%end;
.thread T_1;
# The file index is used to find the file name in the following table.

View File

@ -2,8 +2,7 @@ module subtraction (
input [3:0] A, B,
input BorrowIN,
output [3:0] Y,
output BorrowOut,
output overflow
output BorrowOUT //Overflow signal'ini yani negatif gonderecek
);
wire [3:0] tempB;
@ -12,16 +11,6 @@ wire [3:0] tempB;
fullsubtraction f0 (.A(A[0]), .B(B[0]), .BorrowIN(BorrowIN), .Difference(Y[0]), .BorrowOut(tempB[0]));
fullsubtraction f1 (.A(A[1]), .B(B[1]), .BorrowIN(tempB[0]), .Difference(Y[1]), .BorrowOut(tempB[1]));
fullsubtraction f2 (.A(A[2]), .B(B[2]), .BorrowIN(tempB[1]), .Difference(Y[2]), .BorrowOut(tempB[2]));
fullsubtraction f3 (.A(A[3]), .B(B[3]), .BorrowIN(tempB[2]), .Difference(Y[3]), .BorrowOut(BorrowOut));
// Overflow detection logic as provided
overflowDetect od1 (
.opCode(2'b10),
.A(A),
.B(B),
.Y(Y),
.CarryOUT(BorrowOut),
.overflowDetect(overflow)
);
fullsubtraction f3 (.A(A[3]), .B(B[3]), .BorrowIN(tempB[2]), .Difference(Y[3]), .BorrowOut(BorrowOUT));
endmodule

View File

@ -1,5 +1,5 @@
$date
Fri Dec 20 21:26:28 2024
Sat Dec 21 02:52:14 2024
$end
$version
Icarus Verilog
@ -219,27 +219,55 @@ b110 $
b110 '
b110 Q
#20
1Z
1#
b1100 "
b1100 *
b1100 S
1N
1L
1J
bz100 )
1A
1D
1F
1?
0>
b110 %
b110 (
b110 R
b10 $
b10 '
b10 Q
#30
0!
0V
0J
0#
bz000 )
0A
0L
1U
0E
1G
0D
b1000 "
b1000 *
b1000 S
1N
0P
1\
0B
1<
0B
0F
1K
0O
0Y
1[
0Z
05
1?
04
1>
1H
b100 %
b100 (
@ -247,7 +275,7 @@ b100 R
b1100 $
b1100 '
b1100 Q
#30
#40
1Z
0U
b0 "
@ -269,7 +297,7 @@ b1000 R
b1000 $
b1000 '
b1000 Q
#40
#50
0!
0Z
0V
@ -309,4 +337,4 @@ b1 R
b1111 $
b1111 '
b1111 Q
#50
#60

View File

@ -3,8 +3,7 @@ module subtractionTB;
reg [3:0] A, B;
reg BorrowIN;
wire [3:0] Y;
wire BorrowOut;
wire overflow;
wire BorrowOUT;
// Instantiate the subtraction module
subtraction uut (
@ -12,8 +11,7 @@ subtraction uut (
.B(B),
.BorrowIN(BorrowIN),
.Y(Y),
.BorrowOut(BorrowOut),
.overflow(overflow)
.BorrowOUT(BorrowOUT)
);
initial begin
@ -26,6 +24,7 @@ initial begin
// Apply test cases
#10 A = 4'b0110; B = 4'b0010; BorrowIN = 0; // A = 6, B = 2
#10 A = 4'b0010; B = 4'b0110; BorrowIN = 0; // A = 2, B = 6
#10 A = 4'b1100; B = 4'b0100; BorrowIN = 0; // A = -4, B = 4
#10 A = 4'b1000; B = 4'b1000; BorrowIN = 0; // A = -8, B = -8
#10 A = 4'b1111; B = 4'b0001; BorrowIN = 1; // A = -1, B = 1, with borrow input