Experiment 1.b || 4-bit adder and subtractor || Verilog Code, Working Explanation ||

  Рет қаралды 4,756

Maharshi Sanand Yadav T

Maharshi Sanand Yadav T

Жыл бұрын

#4BitAdder
#4BitSubtractor
#DigitalLogic
#BinaryAddition
#BinarySubtraction
#DigitalCircuits
#ComputerArchitecture
#LogicGates
#HardwareDesign
#ArithmeticLogicUnit
link = www.tmsytutorials.com/4-bit-b...
A 4-bit adder cum subtractor is a digital circuit that can perform both addition and subtraction operations on 4-bit binary numbers. It takes two 4-bit inputs, A and B, and a control signal, which determines whether the circuit performs an addition or subtraction operation.
Here's a description of how a 4-bit adder cum subtractor can be implemented using basic digital logic gates:
Inputs: A (A3A2A1A0), B (B3B2B1B0), and control signal C.
Carry-in and Borrow-in: Initialize two input signals, C_in and B_in, to zero.
Full Adder Circuit: Use four full adders to perform addition or subtraction of the individual bits of A and B.
a. For each bit position (0 to 3), perform the following steps:
Connect the corresponding bits from A and B as inputs to the full adder.
Connect the C_in signal as the carry input to the full adder.
Connect the output carry (C_out) of the full adder to the next full adder's carry input (C_in) and the B_in signal as the borrow input.
Connect the sum output (S) of the full adder to the corresponding bit position in the output result.
Output Result: The sum outputs of the full adders form the 4-bit result of the addition or subtraction operation.
a. If C is set to 0, the circuit performs addition. The result is the sum of A and B.
b. If C is set to 1, the circuit performs subtraction. The result is the difference between A and B.
Carry-out and Borrow-out: The carry-out (C_out) of the most significant full adder represents the carry or borrow generated during addition or subtraction.
a. If C is set to 0, C_out represents the carry generated during addition.
b. If C is set to 1, C_out represents the borrow generated during subtraction.
Overflow Detection: Check for overflow conditions when performing addition or subtraction. Overflow occurs when the sum of two positive numbers yields a negative result or when the sum of two negative numbers yields a positive result.
a. For addition, if the carry-out (C_out) of the most significant full adder is different from the carry-in (C_in), an overflow has occurred.
b. For subtraction, if the borrow-out (B_out) of the most significant full adder is different from the borrow-in (B_in), an overflow has occurred.
That's the basic description of a 4-bit adder cum subtractor. This circuit can be expanded to handle larger numbers by adding more bits and cascading additional full adders.

Пікірлер: 3
@maharshisanandyadav
@maharshisanandyadav 3 ай бұрын
www.tmsytutorials.com/4-bit-binary-adder-and-subtractor-verilog-code-for-4-bit-binary-adder-cum-subtractor/
@sankethts2003
@sankethts2003 10 ай бұрын
Thank u sir it's very helpful
@telugu_classic_tunes1078
@telugu_classic_tunes1078 10 ай бұрын
Sir please make video on linear feedback shift register🙏
Verilog Code Of Single Port RAM with Synchronous READ/WRITE
28:34
Digital2Real Tutorials
Рет қаралды 3,4 М.
Final muy inesperado 🥹
00:48
Juan De Dios Pantoja
Рет қаралды 19 МЛН
ОСКАР ИСПОРТИЛ ДЖОНИ ЖИЗНЬ 😢 @lenta_com
01:01
Khóa ly biệt
01:00
Đào Nguyễn Ánh - Hữu Hưng
Рет қаралды 20 МЛН
4-bit Adder-Subtractor
14:25
Logism Sphere
Рет қаралды 11 М.
4-BIT ADDER AND SUBTRACTOR
13:56
TECH NEWS
Рет қаралды 12 М.
4 BIT RIPPLE CARRY ADDER USING FULLADDER IN VERILOG USING XILINX
9:55
4-bit Adder and Subtractor Circuit Explained
20:38
ALL ABOUT ELECTRONICS
Рет қаралды 324 М.