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

  Рет қаралды 5,021

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.

Пікірлер: 4
@maharshisanandyadav
@maharshisanandyadav 4 ай бұрын
www.tmsytutorials.com/4-bit-binary-adder-and-subtractor-verilog-code-for-4-bit-binary-adder-cum-subtractor/
@sankethts2003
@sankethts2003 11 ай бұрын
Thank u sir it's very helpful
@telugu_classic_tunes1078
@telugu_classic_tunes1078 11 ай бұрын
Sir please make video on linear feedback shift register🙏
@maharshisanandyadav
@maharshisanandyadav 19 күн бұрын
www.tmsytutorials.com/verilog/
Half Adder and Full Adder Explained | The Full Adder using Half Adder
14:20
ALL ABOUT ELECTRONICS
Рет қаралды 526 М.
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 40 МЛН
Каха заблудился в горах
00:57
К-Media
Рет қаралды 10 МЛН
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 37 МЛН
Learn how computers add numbers and build a 4 bit adder circuit
13:39
4-bit Adder and Subtractor Circuit Explained
20:38
ALL ABOUT ELECTRONICS
Рет қаралды 333 М.
How a CPU Instruction Decoder and Instruction Execution Works
14:21
Signals. I spent 2 years to understand this part.
21:24
kimylamp
Рет қаралды 206 М.
4-Bit Full Adder Design with IP Catalog in Xilinx Vivado.
18:28
Dr.HariPrasad Naik Bhattu
Рет қаралды 6 М.
How Do Computers Remember?
19:32
Sebastian Lague
Рет қаралды 6 МЛН
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 40 МЛН