Dla Paper Solutions
Dla Paper Solutions
Dla Paper Solutions
Explain AND and OR gates with help of a diagram and truth table.
The AND gate is so named because, if 0 is called "false" and 1 is called "true," the gate acts in the same way as
the logical "and" operator. The following illustration and table show the circuit symbol and logic combinations
for an AND gate. (In the symbol, the input terminals are at left and the output terminal is at right.) The output
is "true" when both inputs are "true." Otherwise, the output is "false." In other words, the output is 1 only
when both inputs one AND two are 1.
AND gate
Input Input 2 Output
1
0 0 0
0 1 0
1 0 0
1 1 1
The OR gate gets its name from the fact that it behaves after the fashion of the logical inclusive "or." The
output is "true" if either or both of the inputs are "true." If both inputs are "false," then the output is "false." In
other words, for the output to be 1, at least input one OR two must be 1.
OR gate
What are universal gates ? Implement all basic logic gates using universal gates.
Universal Gates may implement any Boolean function without using any other gate type. The NAND gate
and NOR gate are called Universal gates because they can perform all the three essential functions of AND,
OR and NOT gates.
A two-input NAND gate is a digital combination logic circuit that performs the logical inverse of an AND
gate. While an AND gate outputs a logical “1” only if both inputs are logical “1,” a NAND gate outputs a
logical “0” for this same combination of inputs. Here, we will explore the Universal gates, NAND Gate &
NOR Gate, along with a few examples of each.
1. Implementation of AND Gate using Universal gates.
a) Using NAND Gates
The AND gate can be implemented by using two NAND gates in the below fashion:
A’B = (01)2 = m1
AB’ = (10)2 = m2
AB = (11)2 = m3
We saw the conversion of SOP to shorthand notation. Lets check the conversion of shorthand notation to SOP.
Converting shorthand notation to Sum of Products (SOP)
Lets say, we have a boolean function F defined on two variables A and B. So, A and B are the inputs for F and
lets say, the minterms are expressed as shorthand notation given below.
F = ∑(1, 2, 3)our task is to get the SOP.
F has two input variables A and B and output of F = 1 for m1, m2 and m3 i.e., 2nd, 3rd and 4th combination.
we have, F = ∑(1, 2, 3)
= m1 + m2 + m3
= 01 + 10 + 11
To convert from shorthand notation to SOP we follow the given rules. If the variable is 1 then it is taken "as
is" and if the variable is 0 then we take its "complement".
F = ∑(1, 2, 3)
= A’B + AB’ + AB
Example
Lets say, we have a boolean function F defined on two variables A and B. So, A and B are the inputs for F and
lets say, output of F is true i.e., F = 1 when only one of the input is true or 1.
A B F
0 0 0
0 1 1
1 0 1
1 1 0
Now we will create a column for the maxterm using the variables A and B. If input is 1 we take the
complement of the variable and if input is 0 we take the variable as is.
A B F Maxterm
0 0 0 A+B
0 1 1 A + B'
1 0 1 A' + B
1 1 0 A' + B'
To get the desired canonical POS expression we will multiply the maxterms (sum terms) for which the output
is 0.
F = (A+B) . (A’+B’)
F = M0 . M3
We saw the conversion of POS to shorthand notation. Lets check the conversion of shorthand notation to POS.
F = ∏(1, 2, 3)
F has two input variables A and B and output of F = 0 for M1, M2 and M3 i.e., 2nd, 3rd and 4th combination.
we have, F = ∏(1, 2, 3)
= M1 . M2 . M3
= 01 . 10 . 11
To convert from shorthand notation to POS we follow the given rules. If the variable is 0 then it is taken as is
and if the variable is 1 then we take its complement.
we have, F = ∏(1, 2, 3)
= (A+B’) . (A’+B) . (A’+B’)
0 0 0 0 0
0
0
1 0 0 1
2 0 0 1 0
1
4 0 0 0
8 1 1 0 0
6 0 1 1 0
2
9 1 0 1
0
11 1 0 1 1
3
13 1 0 1
1
4 15 1 1 1
1
Now in this circuit, if you provide input at A and B ends. You will get the output on sum and carry ends
according to truth table we have created above. So here we have completed our four steps for creating the
combinational circuit.
Explain the half adder with help of truth table, k-map and block diagram.
A half adder is a digital logic circuit that performs binary addition of two single-bit binary numbers. It has
two inputs, A and B, and two outputs, SUM and CARRY. The SUM output is the least significant bit (LSB)
of the result, while the CARRY output is the most significant bit (MSB) of the result, indicating whether
there was a carry-over from the addition of the two inputs. The half adder can be implemented using basic
gates such as XOR and AND gates.
Sure, here’s a more in-depth explanation of the half adder circuit:
The half adder is a basic building block for more complex adder circuits such as full adders and multiple-bit
adders. It performs binary addition of two single-bit inputs, A and B, and provides two outputs, SUM and
CARRY.
The SUM output is the least significant bit (LSB) of the result, which is the XOR of the two inputs A and B.
The XOR gate implements the addition operation for binary digits, where a “1” is generated in the SUM
output only when one of the inputs is “1”.
The CARRY output is the most significant bit (MSB) of the result, indicating whether there was a carry-over
from the addition of the two inputs. The CARRY output is the AND of the two inputs A and B. The AND
gate generates a “1” in the CARRY output only when both inputs are “1”.
Half Adder (HA):
Half adder is the simplest of all adder circuits. Half adder is a combinational arithmetic circuit that adds two
numbers and produces a sum bit (s) and carry bit (c) both as output. The addition of 2 bits is done using a
combination circuit called a Half adder. The input variables are augend and addend bits and output variables
are sum & carry bits. A and B are the two input bits.
let us consider two input bits A and B, then sum bit (s) is the X-OR of A and B. it is evident from the
function of a half adder that it requires one X-OR gate and one AND gate for its construction.
Truth Table:
Here we perform two operations Sum and Carry, thus we need two K-maps one for each to derive the
expression.
Logical Expression:
For Sum:
Sum = A XOR B
For Carry:
Carry = A AND B
Implementation:
Parallel Adder –
A single full adder performs the addition of two one bit numbers and an input carry. But a Parallel Adder is
a digital circuit capable of finding the arithmetic sum of two binary numbers that is greater than one bit in
length by operating on corresponding pairs of bits in parallel. It consists of full adders connected in a
chain where the output carry from each full adder is connected to the carry input of the next higher order full
adder in the chain. A n bit parallel adder requires n full adders to perform the operation. So for the two-
bit number, two adders are needed while for four bit number, four adders are needed and so on. Parallel
adders normally incorporate carry lookahead logic to ensure that carry propagation between subsequent
stages of addition does not limit addition speed.
Explain 1:2 demux with truth table, block diagram and k-map
There are various types of De-multiplexer which are as follows:
1×2 De-multiplexer:
In the 1 to 2 De-multiplexer, there are only two outputs, i.e., Y 0, and Y1, 1 selection lines, i.e., S 0, and single
input, i.e., A. On the basis of the selection value, the input will be connected to one of the outputs. The block
diagram and the truth table of the 1×2 multiplexer are given below.
Block Diagram:
Truth Table:
Octal To Binary Encoder Octal to binary encoder has 23 = 8 input lines D0 to D7 and 3 output lines Y0 to Y2.
Below is the truth table for octal to the binary encoder.
From the truth table, the outputs can be expressed by following Boolean Function.
Y0 = D 1 + D 3 + D 5 + D 7
Y1 = D 2 + D 3 + D 6 + D 7
Y2 = D 4 + D 5 + D 6 + D 7
Note: Above boolean functions are formed by OR ing all the input lines for which output is 1. For instance
Y0 is 1 for D1, D3, D5, D7 input lines. The encoder can, therefore, be implemented with OR gates whose inputs
are determined directly from the truth table as shown in the image below:
A decade counter is called as mod -10 or divide by 10 counter. It counts from 0 to 9 and again reset to 0. It
counts in natural binary sequence. Here 4 T Flip flops are used. It resets after Q 3 Q2 Q1 Q0 = 1001.
Circuit excitation table –
Here Q3 Q2 Q1 Q0 are present states of four flip-flops and Q*3 Q*2 Q*1 Q*0 are next counting state of 4 Flip
flops. If there is a transition in current state i.e if Q3 value changes from 0 to 1 or 1 to 0 then there’s
corresponding T(toggle) bit is written as 1 otherwise 0.
Step 4 : Create Karnaugh map for each FF input in terms of flip-flop outputs as the input variable –
Simplify the K map –
Explain the D flipflop with help of truth table and block diagram.
D Flip Flop
D flip flop is an electronic devices that is known as “delay flip flop” or “data flip flop” which is used to store
single bit of data.D flip flops are synchronous or asynchronous. The clock single required for the
synchronous version of D flip flops but not for the asynchronous one.The D flip flop has two inputs, data
and clock input which controls the flip flop. when clock input is high, the data is transferred to the output of
the flip flop and when the clock input is low, the output of the flip flop is held in its previous state.
AC and the appended bit Qn+1 are initially cleared to 0 and the sequence SC is set to a number n equal to
the number of bits in the multiplier. The two bits of the multiplier in Qn and Qn+1are inspected. If the two
bits are equal to 10, it means that the first 1 in a string has been encountered.
This requires subtraction of the multiplicand from the partial product in AC. If the 2 bits are equal to 01, it
means that the first 0 in a string of 0’s has been encountered. This requires the addition of the multiplicand to
the partial product in AC. When the two bits are equal, the partial product does not change.
An overflow cannot occur because the addition and subtraction of the multiplicand follow each other. As a
consequence, the 2 numbers that are added always have a opposite signs, a condition that excludes an
overflow. The next step is to shift right the partial product and the multiplier (including Qn+1). This is an
arithmetic shift right (ashr) operation which AC and QR to the right and leaves the sign bit in AC unchanged.
The sequence counter is decremented and the computational loop is repeated n times. Product of negative
numbers is important, while multiplying negative numbers we need to find 2’s complement of the number to
change its sign, because it’s easier to add instead of performing binary subtraction. product of two negative
number is demonstrated below along with 2’s complement.
Example – A numerical example of booth’s algorithm is shown below for n = 4. It shows the step by step
multiplication of -5 and -7.
BR = -5 = 1011,
BR' = 0100, <-- 1's Complement (change the values 0 to 1 and 1 to 0)
BR'+1 = 0101 <-- 2's Complement (add 1 to the Binary value obtained after 1's complement)
QR = -7 = 1001 <-- 2's Complement of 0111 (7 = 0111 in Binary)
The explanation of first step is as follows: Qn+1
AC = 0000, QR = 1001, Qn+1 = 0, SC = 4
Qn Qn+1 = 10
So, we do AC + (BR)'+1, which gives AC = 0101
On right shifting AC and QR, we get
AC = 0010, QR = 1100 and Qn+1 = 1
OPERATION AC QR Qn+1 SC
0000 1001 0 4
AC + BR’ + 1 0101 1001 0
ASHR 0010 1100 1 3
AC + BR 1101 1100 1
ASHR 1110 1110 0 2
ASHR 1111 0111 0 1
AC + BR’ + 1 0100 0111 0
ASHR 0010 0011 1 0
Consider the above 4-bit ripple carry adder. The sum is produced by the corresponding full adder as soon as
the input signals are applied to it. But the carry input is not available on its final steady-state value until
carry is available at its steady-state value. Similarly depends on and on . Therefore, though the carry must
propagate to all the stages in order that output and carry settle their final steady-state value.
The propagation time is equal to the propagation delay of each adder block, multiplied by the number of adder
blocks in the circuit. For example, if each full adder stage has a propagation delay of 20 nanoseconds,
then will reach its final correct value after 60 (20 × 3) nanoseconds. The situation gets worse, if we extend the
number of stages for adding more number of bits.
Carry Look-ahead Adder :
A carry look-ahead adder reduces the propagation delay by introducing more complex hardware. In this
design, the ripple carry design is suitably transformed such that the carry logic over fixed groups of bits of the
adder is reduced to two-level logic. Let us discuss the design in detail.