BCD Adder
BCD Adder
BCD Adder
A BCD (Binary Coded Decimal) Adder is a circuit that adds two BCD digits (4-bit binary
representations of decimal digits). Since BCD digits represent decimal numbers (0–9), the
result of adding two BCD digits can range from 0 to 18. If the sum is less than 10, it is directly
represented in BCD. However, if the sum exceeds 9, a correction is needed by adding 0110 (6
in binary) to the result to ensure it remains a valid BCD digit.
Key Points:
2. Comparators
A comparator is a digital circuit that compares two binary numbers and determines their
relationship. It outputs signals indicating whether one number is greater than, equal to, or
less than the other.
Key Points:
3. Parity Generators
A parity generator is a circuit that generates a parity bit for a given set of data bits. Parity
bits are used for error detection in data transmission. There are two types of parity:
Even Parity: Ensures the total number of 1s (including the parity bit) is even.
Odd Parity: Ensures the total number of 1s (including the parity bit) is odd.
Key Points:
4. Decoder
A decoder is a combinational circuit that converts binary input data into a one-hot output,
meaning only one of the outputs will be active (high) for any given input combination. It
translates n input lines into 2ⁿ output lines.
Key Points:
5. Encoder
An encoder is the reverse of a decoder. It takes multiple input lines and encodes them into a
smaller number of output lines. It produces an n-bit binary code for 2ⁿ input lines.
Key Points:
6. Multiplexer (MUX)
A multiplexer is a combinational circuit that selects one of several input signals and
forwards the selected input to a single output line. It uses selection lines to choose which
input to send to the output.
Key Points:
7. De-multiplexer (DEMUX)
A demultiplexer is the reverse of a multiplexer. It takes a single input signal and distributes it
to one of several output lines based on the value of the selection lines.
Key Points:
Sequential logic circuits store information in the form of binary states and change states
based on a clock signal. Unlike combinational circuits, their outputs depend not only on the
current inputs but also on past inputs (i.e., previous states).
Latches and flip-flops are the basic building blocks of sequential circuits. Both can store a
single bit of data, but they differ in how they respond to inputs.
Latches
A latch is a level-sensitive storage element. It changes its state whenever the input changes
and the enable signal (if present) is active.
SR Latch: Uses two cross-coupled NOR or NAND gates. It has two inputs: Set (S) and
Reset (R). When S = 1, it sets the output to 1, and when R = 1, it resets the output to 0.
D Latch: Has a single input D (data) and an enable signal. When enabled, the output
follows the input.
Flip-Flops
A flip-flop is an edge-triggered storage element that changes state only at the rising or
falling edge of a clock signal.
SR Flip-Flop: Similar to the SR latch but responds to clock edges. It may have an invalid
state if both S and R are 1 simultaneously.
D Flip-Flop: Eliminates the invalid state of the SR flip-flop by using a single input D. The
output changes only at the clock edge and follows the input.
T Flip-Flop: Toggles its state when the input T is 1 and the clock edge occurs.
JK Flip-Flop: A universal flip-flop with two inputs J and K. When both inputs are 1, it
toggles its output, making it more versatile than an SR flip-flop.
Master-Slave JK Flip-Flop: A combination of two JK flip-flops where one acts as the
master (operates on the clock’s rising edge) and the other as the slave (operates on the
clock’s falling edge). This design eliminates race conditions.
2. Asynchronous Inputs
Asynchronous inputs are special inputs to flip-flops that can directly set or reset the output
regardless of the clock signal. Common asynchronous inputs include:
3. Counters
Counters are sequential circuits that count pulses or events. They can be synchronous (all
flip-flops are triggered by the same clock) or asynchronous (flip-flops are triggered by
different clock signals).
Types of Counters
A shift register is a sequential circuit that shifts its stored data in a specified direction (left
or right) on each clock pulse. It is built using flip-flops connected in series.
1. Serial-In Serial-Out (SISO): Data is shifted in serially and shifted out serially.
2. Serial-In Parallel-Out (SIPO): Data is shifted in serially and output in parallel.
3. Parallel-In Serial-Out (PISO): Data is loaded in parallel and shifted out serially.
4. Parallel-In Parallel-Out (PIPO): Data is loaded and output in parallel.
1. Ring Counter
A ring counter is a circular shift register where the output of the last flip-flop is fed
back to the input of the first flip-flop.
It has a single ‘1’ circulating through the flip-flops.
Example: A 4-bit ring counter cycles through four states (0001, 0010, 0100, 1000).
2. Johnson Counter
A Johnson counter (also called a twisted ring counter) is similar to a ring counter, but
the inverted output of the last flip-flop is fed back to the input of the first flip-flop.
It cycles through twice as many states as a ring counter with the same number of flip-
flops.
Example: A 4-bit Johnson counter cycles through 8 states (0000, 0001, 0011, 0111,
1111, 1110, 1100, 1000).
Would you like further explanations or examples for any of these counters?