Home.Verilog.Digital Design.Digital Basics.Python.RF Basics.
Previous.
Next.
Custom Search

Feedback ? Send it to admin@fullchipdesign.com or join me at fullchip@gmail.com

Legal Disclaimer

Chip Designing for ASIC/ FPGA Design engineers and Students
FULLCHIPDESIGN
Digital-logic Design...  Dream for many students… start learning front-end…

Legal Disclaimer

PICS
Verilog Tutorial.
N bit Binary adder-subtractor discussion with circuit and example for 4 bits
Introduction:-
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.
Full-Adder
Full-Adder
Full-Adder
Full-Adder
A0
A3
B2
A2
B1
A1
B0
B3
S3
S2
S1
S0
C2
C3
C0
C1
C4
Switch Mode
(SM)
Discussion of Adder-Subtractor circuit
Interview Questions. Main, FPGA, Digital Fundamentals
Clock Crossing Async FIFO Half Adder Full Adder Binary Adder Overflow Overflow Det Adder-Subtractor Multiplier Parity check RTL guidelines NAND to INVERTER VHDL RTL Arith Micro-ops Stack Org Parallel proc. Pipeline proc CMOS Intro
Circuit Level Implementation