0% found this document useful (0 votes)
4K views

Binary Subtraction Addition Flowchart

The document describes the flowchart for performing binary addition and subtraction. It starts by initializing variables like the two binary numbers, their lengths, an array to store carries, and a counter. It then enters and compares the lengths of the two numbers, potentially shifting one to align them. It iterates through each bit position, adding or subtracting the bits and carrying values, and storing the results in the output array. It continues until all bit positions are processed up to the maximum length, then displays the final output array containing the result.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4K views

Binary Subtraction Addition Flowchart

The document describes the flowchart for performing binary addition and subtraction. It starts by initializing variables like the two binary numbers, their lengths, an array to store carries, and a counter. It then enters and compares the lengths of the two numbers, potentially shifting one to align them. It iterates through each bit position, adding or subtracting the bits and carrying values, and storing the results in the output array. It continues until all bit positions are processed up to the maximum length, then displays the final output array containing the result.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

START N-Bit Binary Addition Flowchart

N1=Binary Numbers 1
N2=Binary numbers 2
Len1=Length of N1
Len2=Length of N2
ArrC=Array of Carries
ArrRes=Array of Result
cnt=Counter

cnt=0
ArrC=0
ArrRes=0

Enter N1
Enter N2

Len1=Len2 Len1>Len2 Shift Left N1,


No No
? ? Add 0

Yes

Yes
Shift Left N2,
Add 0

Add N1cnt, N2cnt


and ArrCcnt

ArrRescnt=Sum

N1cnt=1 No
Yes AND No
N2cnt=1
?

cnt=cnt+1 cnt=cnt+1

ArrCcnt=1 ArrCcnt=0

If
Yes cnt=Len1
?

If
ArrCcnt=1 Yes ArrRescnt=ArrCcnt
?

DISPLAY
No
ArrRes

END
START N-Bit Binary Subtraction Flowchart

N1=Binary Numbers 1
N2=Binary numbers 2
Len1=Length of N1
Len2=Length of N2
ArrC=Array of Carries
ArrRes=Array of Result
cnt=Counter

cnt=0
ArrC=0
ArrRes=0

Enter N1
Enter N2

Len1=Len2 Len1>Len2 Shift Left N1,


No No
? ? Add 0

Yes

Yes
Shift Left N2,
Add 0

N2cnt=1
No Yes
?

N2cnt=1 N2cnt=0

If
Set cnt=0 Yes cnt=Len1 No cnt=cnt+1
?

If
No
ArrCcnt=1 No Set cnt=0
ADDITION ?

Yes

If Set cnt=0
cnt=Len1
? No ArrRescnt=1 Yes No
ArrRescnt=ArrRescnt+1

ArrRescnt=1 ArrRescnt=0

If
Display ArrRes cnt=Len1
?

Yes
Shift left, ArrRes
Add -
END

You might also like