Chip Designing for ASIC/ FPGA Design engineers and Students
Digital-logic Design... Dream for many students… start learning front-end…
Get Noticed:- Submit your own content to be published on fullchipdesign.com
Send it to fullchip@gmail.com
Binary addition or subtraction can be implemented using a single circuit as discussed below. With this implementation any length (no of bits = N) of binary numbers can be used to calculate the results by using N number of full-adders and N number of XOR gates.
Circuit is very similar to binary adder circuit except of a XOR gate at second input to full-adders.
Switch Mode (SM) is a control input to the circuit to switch between addition or subtraction operations.
Adder
When SM = 0 the circuit is equivalent to Binary Adder.
B (bit ) XOR 0 = B (bit)
Subtractor
When SM = 1 the circuit is equivalent to Binary subtractor.
B (bit ) XOR 1 = invert(B (bit))
‘B’ input become’s and inverted in this case.
Examples
Refer following sections @ fullchipdesign for examples:-
Binary adder example.
Subtraction examples - Unsigned numbers.
Subtraction examples - Signed numbers.
Discussion of Adder-Subtractor circuit
Circuit Level Implementation