DF 220280152057
DF 220280152057
ENROLLMENT NUMBER:220280152057
TOPIC:DIGITAL FUNDAMENTALS
-EXPERIMENT 1
-THEORY:
Logic gates are fundamental building blocks of
digital circuits and are based on Boolean algebra.
Here's a brief overview of some common logic
gates:
1. AND Gate
- Description: Output is true only when all inputs
are true.
- Boolean Expression:Y=A.B
- Truth Table:
|A|B|Y |
|---|---|------|
|0|0| 0 |
|0|1| 0 |
|1|0| 0 |
|1|1| 1 |
2. OR Gate :
- Description:Output is true if at least one input
is true.
- Boolean Expression:Y = A + B
- Truth Table:
|A|B| Y |
|---|---|------|
|0|0| 0 |
|0|1| 1 |
|1|0| 1 |
|1|1| 1 |
3. NOT Gate:
- Description: Output is the inverse of the input.
- Boolean Expression: Y = A'
- Truth Table:
|A| Y |
|---|----|
|0| 1 |
|1| 0 |
4. NAND Gate:
- Description:Functions as an AND gate followed
by a NOT gate.
- Boolean Expression:Y=(A.B)'
- Truth Table:
|A|B| Y |
|---|---|---- |
|0|0| 1 |
|0|1| 1 |
|1|0| 1 |
|1|1| 0 |
5. NOR Gate:
- Description:Functions as an OR gate followed by
a NOT gate.
- Boolean Expression:Y=(A+B)'
- Truth Table:
|A|B|Y |
|---|--|-----|
|0|0| 1 |
|0|1| 0 |
|1|0| 0 |
|1|1| 0 |
6. XOR Gate:
- Description: Outputs true if inputs are different.
- Boolean Expression: Y = A'B+AB'
- Truth Table:
|A|B|Y |
|---|---|----|
|0|0| 0 |
|0|1| 1 |
|1|0| 1 |
|1|1| 0 |
7. XNOR Gate:
-Description: Outputs true if both inputs are equal.
- Boolean Expression:Y+AB+A'B'
- Truth Table:
|A|B|Y |
|---|---| ----|
|0|0| 1 |
|0|1| 0 |
|1|0| 0 |
|1|1| 1 |
IMPLEMENTATION:
--THEORY:
1)Sum of Products (SOP):
Definition:
-SOP is a way of representing Boolean functions by
expressing them as the logical OR (sum) of product
terms.
-Each product term is a logical AND of one or more
literals (variables or their complements).
Example:
-Consider a 2-input AND gate with inputs A and B.
The SOP expression for the AND gate is
F(A,B)=A⋅B.
2) Product of sum(POS):
Definition:
-POS is another way of representing Boolean
functions by expressing them as the logical AND
(product) of sum terms.
-Each sum term is a logical OR of one or more
literals (variables or their complements).
-The general form of a POS expression is given by:
F(A,B,C,…)=∏(M1,M2,M3...........)
-Here, M1,M2,M3.... are sum terms and ∏ denotes
logical AND.
-IMPLEMENTATION:
HERE IS HANDWRITTEN SOLUTION:
-IMPLEMENTATION IN LOGISIM
-THEORY
Karnaugh Map (K-Map) is a graphical method used
for simplifying Boolean functions and minimizing
the number of logic gates in a digital circuit. The
method is particularly effective for functions with a
small number of variables. Here's a step-by-step
explanation of how to solve a Boolean function
using the K-Map method:
-HANDWRITTEN SOLUTION
-IMPLEMENTATION IN LOGISIM:
-THEORY:
Certainly!The Quine-McCluskey method is a systematic and iterative
approach for simplifying Boolean functions. It is used to minimize the
number of terms in a Boolean expression, leading to a more efficient
representation of digital circuits. The method is especially effective for
functions with a larger number of variables. Here's a step-by-step
description of the Quine-McCluskey method:
-HANDWRITTEN SOLUTION:
-CIRCUIT IMPLEMENTED IN LOGISIM
-THEORY:
BCD Code (Binary-Coded Decimal):
Decimal BCD
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
Excess-3 Code:
Decimal Excess-3
0 0011
1 0100
2 0101
3 0110
4 0111
5 1000
6 1001
7 1010
8 1011
9 1100
->IMPLEMENTATION IN LOGISIM:
->THEORY:
BCD Code (Binary-Coded Decimal):
Decimal BCD
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
Gray Code:
-Gray code, also known as reflected binary code or unit distance code, is
a binary numeral system where two successive values differ in only one
bit. The advantage of Gray code is that it minimizes errors in binary
systems, as only one bit changes at a time during the transition from
one value to the next.
-Consecutive Numbers Differ by One Bit:
In Gray code, as you move from one number to the next, only one bit
changes. This property reduces the likelihood of errors during
transitions.
Applications:
Gray code is commonly used in rotary encoders, where it helps in
reducing errors when the encoder changes its position.
Example:
Let's take a 3-bit Gray code sequence:
Decimal Binary Gray Code
0 000 000
1 001 001
2 010 011
3 011 010
4 100 110
5 101 111
6 110 101
7 111 100
BCD to Gray Code Converter:
A BCD to Gray code converter is a combinational circuit that takes a
Binary Coded Decimal (BCD) input and produces the corresponding Gray
code output. BCD is a binary representation of decimal digits, where
each decimal digit is represented by a 4-bit binary code.
Truth Table:
Let's consider a 4-bit BCD to Gray code converter. The input has four bits
(A, B, C, D), and the output has four bits (G0, G1, G2, G3) representing
the Gray code.
A B C D G0 G1 G2 G3
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 1
1 1 0 1 1 0 1 0
1 1 1 0 1 0 0 1
Circuit:
The circuit for a 4-bit BCD to Gray code converter is built using XOR
gates. Each output bit (G0, G1, G2, G3) is generated by XORing specific
BCD input bits.
For example:
G0 = A
G1 = A XOR B
G2 = B XOR C
G3 = C XOR D
This way, the XOR gates create the Gray code outputs based on the BCD
input.
->IMPLEMENTATION:
->Theory:
-HALF ADDER
=>A half adder is a fundamental digital circuit used in computer
systems to add two binary digits.
=>The half adder produces two outputs: the sum (S) and the
carry (C).
=>Let's explore the truth table for a half adder to understand its behavior
A B sum carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
It is observed that:
-FULL ADDER
=>The full adder produces two outputs: the sum (S) and the carry out
(Cout).
=>The sum (S) is the result of adding the three inputs, which is
determined using XOR and AND operations.
=>Let's explore the truth table for a full adder to understand its
behavior.
A B Cin SUM Cout
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
->IMPLEMENTATION
->THEORY:
-HALF SUBTRACTOR
=>A half subtractor is a digital circuit used in digital electronics to subtract two
single-bit binary numbers. It's one ofthe fundamental building blocks in digital
circuit design, particularly in the construction of more complex
subtraction and arithmetic units. The half subtractor performs the subtraction of
two binary digits, taking into account the borrow generated during the
subtraction.
=>Two Inputs (A and B): These inputs represent the two binary numbers that
need to be subtracted. A is the
minuend (the number from which subtraction is done), and B is the subtrahend
(the number to be subtracted).
Difference (D): This output represents the result of subtracting B from A. It is the
binary difference between A and B.
=>Borrow (B_out): This output indicates whether there is a borrow generated
during the subtraction. If A is smaller than B, a borrow is generated, and B_out is
set to 1; otherwise, it's 0.
Observation:
B_out is the resut of and operation between A’ anB
Diff is result of XOR operation between A and B
IMPLEMENTATION
-FULL SUBTRACTOR:
=>A Full Subtractor is a digital circuit used in digital electronics and digital
arithmetic to subtract three single-bit binary numbers: the minuend (A), the
subtrahend (B), and a borrow-in (B_in).
=>It is more complex than a Half Subtractor, which only subtracts two numbers
and computes a borrow. The Full Subtractor, on the other hand, can perform
complete binary subtraction, considering both the inputs and any borrow from a
previous subtraction.
=>Inputs:
=>Outputs:
Difference (D): This output represents the result of subtracting B from A, including
any borrow from B_in.
Borrow-out (B_out): Indicates whether there is a borrow generated during the
subtraction. If A is smaller
than (or equal to) B, or if B_in is 1, a borrow is generated, and B_out is set to 1;
otherwise, it's 0.
-OBSERVATION:
DIFF is the result of XOR operation between A XOR B and Bin
Bout=A’B’Bin+A’BBin’+A’BBin+ABBin
-IMPLEMENTATION:
->THEORY:
Multiplier
A binary multiplier is a combinational logic circuit used in
digital systems to perform the multiplication of two binary
numbers. These are most commonly used in various
applications especially in the field of digital signal processing
to perform the various algorithms.
0 × 0 = 0
0 × 1 = 0
1 × 0 = 0
1 × 1 = 1
-Inputs:
A and B: The binary numbers to be compared.
Outputs:
A > B: High (1) if A is greater than B, Low (0) otherwise.
A = B: High (1) if A is equal to B, Low (0) otherwise.
A < B: High (1) if A is less than B, Low (0) otherwise.
The outputs of the individual stages are used to determine the overall relationship
between the two n-bit numbers (greater than, equal to, or less than).
Example:
For a 4-bit comparator, you would have four 1-bit comparators connected in
series. The outputs from these comparators are then combined to determine the
relationship between the two 4-bit numbers.
The general approach is to start by comparing the most significant bits and
propagate the results through the less significant bits if needed.
-IMPLEMENTATION: