DSD LAB Print-III
DSD LAB Print-III
Theory:
Circuits that take the logical decision are called logic gates. Each gate has one or more input and only
one output. OR, AND and NOT are basic gates. NAND and NOR are known as universal gates, since basic
gates can be formed from these gates.
Working principle:
And Gate:
The AND gate performs a logical multiplication commonly known as AND function. The output is
high when both the inputs are high. The output is low level when any one of the inputs is low.
Or Gate:
The OR gate performs a logical addition commonly known as OR function. The output is high
when any one of the inputs is high. The output is low level when both the inputs are low.
Not Gate:
The NOT gate is called an inverter. The output is high when the input is low. The output is
low when the input is high. Here odd numbered pins represents inputs, even numbered pins represents
outputs. Seventh pin represents ground, fourteen pin represents VCC supply voltage.
Nand Gate:
The NAND gate is a contraction of AND-NOT. The output is high when both inputs arelow
and any one of the input is low. The output is low level when both inputs are high.
Nor Gate:
The NOR gate is a contraction of OR-NOT. The output is high when both inputs are low.
The output is low when one or both inputs are high.
X- Or Gate:
The output is high when any one of the inputs is high. The output is low when both theinputs are
low and both the inputs are high.
Experiment Procedure:
Pin Diagram
Pin Diagram
Pin Diagram
Pin Diagram
Pin Diagram
Thus the truth table of all logic gates have been verified.
Experiment No: 2a
Date: ……. /……. /……………
Aim: To design and implement adder and subtractor circuits using logic gates.
Theory:
Half Adder:
A half adder has two inputs for the two bits to be added and two outputs one from the sum
‘S’ and other from the carry ‘ c’ into the higher adder position. Above circuit is called asa carry signal
from the addition of the less significant bits sum from the X-OR Gate the carry out from the AND gate.
Full adder:
A full adder is a combinational circuit that forms the arithmetic sum of input; it consists of three
inputs and two outputs. A full adder is useful to add three bits at a time but a half adder cannot do so.
In full adder sum output will be taken from X-OR Gate, carry output will be taken from OR Gate.
Half subtractor:
The half subtractor is constructed using X-OR and AND Gate. The half subtractor has two input
and two outputs. The outputs are difference and borrow. The difference can be applied using X-OR
Gate, borrow output can be implemented using an AND Gate and an inverter.
Full subtractor:
The full subtractor is a combination of X-OR, AND, OR, NOT Gates. In a full subtractor the
logic circuit should have three inputs and two outputs. The two half subtractor put together gives a full
subtractor .The first half subtractor will be C and A B. The output will be difference output of full
subtractor. The expression AB assembles the borrow output of the half subtractor and the second term
is the inverted difference output of first X-OR.
Experiment Procedure:
K-map simplification:
Logic diagram:
Full adder:
Truth table:
K-map simplification:
Logic diagram:
Truth table:
Halfsubtractor:
K-map simplification:
Logic diagram:
Full subtractor:
Truth table:
K-map simplification:
Logic Diagram:
Logic Diagram:
D-Difference B- Borrow
Result:
Thus the adder and subtractor logic circuits were designed and their outputs were verified.
Experiment No: 2b
Date: ……. /……. /……………
Theory:
The availability of large variety of codes for the same discrete elements of information results
in the use of different codes by different systems. A conversion circuit must be inserted between the two
systems if each uses different codes for same information. Thus, code converter is a circuit that makes
the two systems compatible even though each uses different binary code.
Gray code is a non-weighted code. The input variable are designated as B3, B2, B1, B0 and the
output variables are designated as G3, G2, G1, G0. From the truth table, combinational circuit is
designed. The Boolean functions are obtained from K-Map for each output variable.
To convert from binary code to Excess-3 code, the input lines must supply the bit combination
of elements as specified by code and the output lines generate the correspondingbit combination of
code. Each one of the four maps represents one of the four outputs of the circuit as a function of the four
input variables
A two-level logic diagram may be obtained directly from the Boolean expressions derived by
the maps. These are various other possibilities for a logic diagram that implements this circuit. Now the
OR gate whose output is C+D has been used to implement partially each of three outputs.
Binary to gray code converter:
Here the input is binary code and the output obtained is gray code. The reflected binary code, also
known as Gray code after Frank Gray, is a binary numeral system where two successive values differ in only
one bit. The design steps are first truth table is given, secondly the K map simplification for thetruth table is
done. Thirdly the logic diagram for the equations is drawn. Gray code differs from binary code as bit patterns
change “10” changed to “11” and “11” changed to “10”.
Practical application:
• Towers of Hanoi
• Due to the Hamming distance properties of Gray codes, they are sometimes used in Genetic
Algorithms
• Gray codes are also used in labeling the axes of Karnaugh maps
• When Gray codes are used in computers to address program memory, the computer uses lesspower
because fewer address lines change as the program counter advances.
• Gray codes are widely used to facilitate error correction in digital communications such as
digital terrestrial television and some cable TV systems
• It is used to indicate angular position of shaft on rotating machinery such as automated lathesand
drill presses.
• Communication between clock domains
• Gray code counters and arithmetic
Gray code to binary converter :
BINARY code is a way of representing the text or the data generated by the computers and other
devices. Today's digital computer works on discontinuous data i.e. data is not flowing continuously thus it
uses binary code 0(off) and one (on) to indicate when there is a flow and when there is not. In binary coding
the text or the data is represented in a stream of bits of 1's and 0's .Here the input is Gray code and the output
obtained is binary code. The design steps are first truth table is given, secondly the K map simplification for
the truth table is done. Thirdly the logic diagram for the equations is drawn. Gray code differs from binary
code as bit patterns change “10” changed to “11” and “11” changed to “10”.
Excess- 3codes:
Excess-3 binary-coded decimal (XS-3) or Stibitz code, also called biased representation or Excess-
N, is a complementary BCD code and numeral system. Excess-3 was used on some older computers as well
as in cash registers and hand held portable electronic calculators of the 1970's, among other uses. It is a way
to represent values with a balanced number of positive and negative numbers using a pre-specified number
N as a biasing value. The primary advantage of XS-3 coding over BCD coding is that a decimal number can
be nines' complemented (for subtraction) as easily as abinary number can be ones' complemented; just invert
all bits.
Applications of EXCESS- 3 codes:
• Excess-3 was used on some older computers as well as in cash registers and hand held
portable electronic calculators of the 1970's, among other uses.
• One very basic use of the Excess3 code is that you can easily compute subtractions involving 9.All
you have to do is invert the bits.
It is a non-weighted code. In XS-3, numbers are represented as decimal digits, and each digit is
represented by four bits as the digit value plus 3 (the "excess" amount) Here the input is BCD input and the
output obtained is Excess-3 output. One very basic use of the Excess3 code is that you can easily compute
subtractions involving 9; all you have to do is invert the bits. For example, the Excess3code for 5 is 1000.
Suppose you have to find out 9 - 5. The answer should be 4. To execute the subtraction in Excess3, all you
need to do is invert the bits of the Excess3 code for 5. The answer will be 0111 which is the Excess3 code of
4.
Here the input is obtained is Excess-3 and output is BCD code. Excess 3 codes are generated by
adding three to binary value. For Example, excess 3 values for 0 is 3, i.e. 0+3 is 3.
Experiment Procedure:
Truth table:
B3 B2 B1 B0 G3 G2 G1 G0
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 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0
K-map Simplification:
G3 = B 3
Logic diagram
:
Gray code to binary code converter:
Truth table:
G3 G2 G1 G0 B3 B2 B1 B0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 1 0 0 1 0
0 0 1 0 0 0 1 1
0 1 1 0 0 1 0 0
0 1 1 1 0 1 0 1
0 1 0 1 0 1 1 0
0 1 0 0 0 1 1 1
1 1 0 0 1 0 0 0
1 1 0 1 1 0 0 1
1 1 1 1 1 0 1 0
1 1 1 0 1 0 1 1
1 0 1 0 1 1 0 0
1 0 1 1 1 1 0 1
1 0 0 1 1 1 1 0
1 0 0 0 1 1 1 1
K-map Simplification:
B3 = G3
B3 B2 B1 B0 E3 E2 E1 E0
0 0 0 0 0 1 1
0 0 0 1 0 1 0 0
0 0 1 0 0 1 0 1
0 0 1 1 0 1 1 0
0 1 0 0 0 1 1 1
0 1 0 1 1 0 0 0
0 1 1 0 1 0 0 1
0 1 1 1 1 0 1 0
1 0 0 0 1 0 1 1
1 0 0 1 1 1 0 0
1 0 1 0 x x x x
1 0 1 1 x x x x
1 1 0 0 x x x x
1 1 0 1 x x x x
1 1 1 0 x x x x
1 1 1 1 x x x x
K-map Simplification:
E3 = B3 + B2 (B0 + B1)
Truth table:
Result:
Thus the code converters were designed and their truth table were verified.
Experiment No: 2c
Date: ……. /……. /……………
4 – Bit adder/subtractor:
The addition and subtraction operation can be combined into one circuit with one common
binary adder. The mode input M controls the operation. When M=0, the circuit is adder circuit.
When M=1, it becomes subtractor.
BCD Adder:
Computers or calculators that perform arithmetic operations directly in the decimal number
system represent decimal numbers in binary – coded form. A BCD adder is a circuitthat adds two
BCD digits in parallel and produces a sum digit in BCD and a carry. BCDadder must include
correction logic in its internal construction. A BCD digit can have any of the ten possible four-bit
binary representations, that is, 0000, 0001, , 1001, the equivalent
of decimal numbers 0, 1, , 9. When we set out to add two BCD digits and we assume that
there is an input carry too, the highest binary number that we can get is the equivalent of decimal
number 19 (9+9+1).
• Add the two BCD numbers, using the rules for binary addition
• If a 4-bit sum is equal to or less than 9, it is a valid BCD number.
• If a 4-bit sum is greater than 9, or if a carry out of the 4-bit group is generated, it is an
invalid result. Add 6 (0110) to the 4-bit sum in order to skip the six invalid states and
return the code to 8421. If a carry results when 6 is added, simply add the carry to the
next 4-bit group.
Working principle:
• The circuit performs addition as well as subtraction .When‘s’ input is low the circuit
performs addition.
• The EX-OR gate acts as a controlled inverter (i.e., it inverts input when control is
high; otherwise it passes the input to the output).
• The output of EX-OR gate is same as the ‘Y’ input When‘s’ input is low.
• The output of the circuit is sum of two input numbers when‘s’ input is low.
• When‘s’ input is HIGH the EX-OR gate acts as inverter and its output is the complement
of input.
• The carry input of the first full adder is ‘1’.The output of the circuit is the sum A,
complement of B and 1.
• This performs 2’s complement subtraction .The output of the circuit is in true magnitude
form if the A>B .The output of the circuit is in 2’scomplement form if the A<B.
Working principle: BCD Adder:
• The two decimal digits, together with the input carry, are first added in the top 4-bitadder
to produce the binary sum.
• When the output carry is equal to zero, nothing is added to the binary sum.
• When it is equal to 1, binary 0110 is added to the binary sum through the bottom4-bit
adder.
• A decimal parallel adder that adds n decimal digits needs n BCD adder stages.
• The output carry from one stage must be connected to the input carry of the next
higher-order stage.
Logic diagram:
Truth Table of 4 – bit adder/subtractor:
BCD Adder:
Logic diagram:
SL.NO A4 A3 A2 A1 B4 B3 B2 B1 C S4 S3 S2 S1
1 0 0 0 1 0 0 1 0 0 0 0 1 1
2 0 1 1 0 1 0 0 0 1 0 1 0 0
3 1 0 0 1 1 0 1 0 1 1 0 0 1
Result:
Thus the 4 bit parallel adder/Subtractor, BCD Adder circuits were designed and
their function tables were verified.
Experiment No: 3
Date: ……. /……. /……………
Aim: To design and implement 4:1Multiplexer and 1:4 Demultiplexer circuits using
logic gates.
Theory:
Digital computers process and transfer a tremendous amount of digital signals. It would be
prohibitive to make separate straight – wire connections for the transfer of all the data within the
computer or to a peripheral device. With a procedure called multiplexing, onewire is used to replace
many wires for transferring signals between multiple sources. Multiplexing and demultiplexing are
used to perform multiplexing. One of the first applications of multiplexing was the transmission of
telephone signals. This method enabled several telephone conversations to be sent simultaneously
over the same wire.
In electronics, a multiplexer or mux or data selector is a device that selects one of several
analog or digital input signals and forwards the selected input into a single line. A multiplexer of 2 n
inputs has n select lines, which are used to select which input line to send to the output. An electronic
multiplexer can be considered as a multiple-input, single-output switch i.e. digitally controlled multi-
position switch. The digital code applied at the select inputs determines which data inputs will be
switched to output.
Demultiplexer (or demux) or data distributor is a device taking a single input signal and
selecting one of many data-output-lines, which is connected to the single input. A multiplexer is
often used with a complementary demultiplexer on the receiving end. A demultiplexer is a single-
input, multiple-output switch. Demultiplexer is logic circuit that receives information on a single
input and transmits the same information over one of several (2n) output lines. Demultiplexers
take one data input and a number of selection inputs, and they have several outputs. They forward
the data input to one of the outputs depending on the values of the selection inputs.
Working principle of 4:1multiplexer:
• A multiplexer of 2n inputs has n select lines, which are used to select which input line
to send to the output.
• A selector chooses a single data input and passes it to the MUX output
• Multiplexer has one output selected at a time.
• 4:1 multiplexer has 4 i/p lines, one output line and 2 select lines.
• 2 select lines can have four combinations.
• If the select lines AB =00 then i0 is selected
• If the select lines AB =01 then i1 is selected
• If the select lines AB =10 then i2 is selected
• If the select lines AB =11 then i3 is selected
Function Table:
Function table:
Selection line Values Output
S1 S0 D0 D1 D2 D3
0 0 I/P 0 0 0
0 1 0 I/P 0 0
1 0 0 0 I/P 0
1 1 0 0 0 I/P
Pin diagram of IC 7411
Thus 4:1 Multiplexer and 1:4 Demultiplexer were designed and their function tables were verified.
Experiment No: 4
Date: ……. /……. /……………
Theory:
In digital electronic projects, the encoder and decoder play an important role. It is used to convert the data
from one form to another form. Generally, these are frequently used in the communication systems like
telecommunication, networking, and transfer the data from one end to the other end. In the same way, it
is also used in the digital domain for easy transmission of data, placed with the codes, and then transmitted.
At the end of the receiver, the coded data are collected from the code and then processed to display.
An encoder in digital electronics is a one-hot to binary converter. That is, if there are 2n input lines, and
at most only one of them will ever be high, the binary code of this 'hot' line is produced on the n-bit
output lines. A binary encoder is the dual of a binary decoder.
For example, a 4-to-2 simple encoder takes 4 input bits and produces 2 output bits.
A decoder is a multiple-input, multiple-output combinational logic circuit..Decoder is a combinational
circuit that has 'n' input lines and maximum of 2n output lines. One of these outputs will be active
High based on the combination of inputs present, when the decoder is enabled. That means decoder
detects a particular code.
Experiment Procedure:
8:3
Truth Table:
Inputs Outputs
Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 A2 A1 A0
1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 0 1 1 1 1
Decoder:
Block diagram:
2 to 4 Decoder:
Truth Table:
Inputs outputs
Enable(E) A B Y0 Y1 Y2 Y3
0 X X 0 0 0 0
1 0 0 1 0 0 0
1 0 1 0 1 0 0
1 1 0 0 0 1 0
1 1 I 0 0 0 1
Logic Circuit:
Result:
Thus Encoder and Decoder combinational circuits were designed and their truth table were verified.
Experiment No:54 c
Experiment No:
Date:…….
Date: /…….
……. /……. /………… …
/……………
Theory:
Working principle:
The upper part of the table describes the normal operation under all conditions that will
occur in a single device or in a series expansion scheme. In the upper part of the table the three
outputs are mutually exclusive. In the lower part of the table, the outputs reflect the feed-forward
conditions that exist in the parallel expansion scheme.
The expansion inputs I A>B, and I A=B and I A<B are the least significant bit positions.
When used for series expansion, the A>B, A=B and A<B outputs of the lease significant word
are connected to the corresponding I A>B, I A=B and I A<B inputs of the next higher stage. Stages
can be added in this manner to any length, but a propagation delay penalty of about 15ns is
added with each additional stage.
Experiment Procedure:
Truth Table:
( A=B) = E = (A0 EX-NOR B0) (A1 XE-NOR B1)
Logic Circuit:
Truth Table:
Observation table:
0 0 1 1 0 0 0 0 0 1 1 1 0 0
0 0 1 0 1 0 1 1 1 0 0 0 1 0
0 0 1 1 0 0 1 1 0 0 1 0 0 1
Result:
Thus the magnitude comparator was designed and truth table was verified.
Experiment No: 6a
Date: ……. /……. /……………
Theory:
A counter is a register capable of counting number of clock pulse arriving at its clockinput.
Counter represents the number of clock pulses arrived. A specified sequence ofstates appears as
counter output. This is the main difference between a register and a counter. There are two types
of counter, synchronous and asynchronous.
In synchronous common clock is given to all flip flop and in asynchronous first flip flop is
clocked by external pulse and then each successive flip flop is clocked by Q or Q output of previous
stage. A soon the clock of second stage is triggered by output of first stage.
Working Principle:
Experiment Procedure:
Truth Table:
Clock
Pulse Q1 Q2 Q3
(CP)
0
0 0 0
1
1 0 0
0
2 0 1
1
3 0 1
0
4 1 0
1
5 1 0
6 1 1 0
7 1 1 1
8 0 0 0
3 Bit Synchronous down Counter:
Logic Circuit:
Truth Table:
Clock
Pulse Q1 Q2 Q3
(CP)
0
0 0 0
1
1 1 1
0
2 1 1
1
3 1 0
0
4 1 0
1
5 0 1
0
6 0 1
1
7 0 0
0
8 0 0
Thus 3 Bit Synchronous Counter was designed and the truth table was verified.
Experiment No: 6B
Date: ……. /……. /……………
Theory:
A ripple counter is an asynchronous counter where only the first flip-flop is clockedby an
external clock. All subsequent flip-flops are clocked by the output of the preceding flip-flop.
Asynchronous counters are also called ripple-counters because of the way the clock pulse ripples
it way through the flip-flops.
The MOD of the ripple counter or asynchronous counter is 2n if n flip-flops are used. For
a 4-bit counter, the range of the count is 0000 to 1111 (24-1). A counter may count upor count
down or count up and down depending on the input control. The count sequence usually repeats
itself. When counting up, the count sequence goes from 0000, 0001, 0010, ...1110 , 1111 , 0000,
0001, ... etc. When counting down the count sequence goes in the opposite manner: 1111, 1110,
... 0010, 0001, 0000, 1111, 1110, ... etc.
The complement of the count sequence counts in reverse direction. If the
uncomplemented output counts up, the complemented output counts down. If the uncomplemented
output counts down, the complemented output counts up.
There are many ways to implement the ripple counter depending on thecharacteristics of
the flip flops used and the requirements of the count sequence.
• Clock Trigger: Positive edged or Negative edged
• JK or D flip-flops
• Count Direction: Up, Down, or Up/Down
Experiment Procedure:
Clock
Pulse Q2 Q1 Q0
(CP)
0
0 0 0
1
1 0 0
0
2 0 1
1
3 0 1
0
4 1 0
1
5 1 0
0
6 1 1
1
7 1 1
0
8 0 0
Clock
Pulse Q2 Q1 Q0
(CP)
0
0 0 0
1
1 1 1
0
2 1 1
1
3 1 0
0
4 1 0
1
5 0 1
0
6 0 1
1
7 0 0
0
8 0 0
Logic diagram:
Truth table:
Result:
Thus Asynchronous Counter was designed and truth table was verified.
Experiment No: 7
Date: ……. /……. /……………
Aim:
To design, implement and verify the functioning of shift right registers
using D flip-flop.
Equipment and Components Required:
Theory:
A register that is used to store binary information is known as a memory register.
A register capable of shifting binary information either to the right or the left is called a
shift register. Shift registers are classified into four types,
1. Serial-in Serial-out (SISO)
2. Serial-in Parallel-out (SIPO)
3. Parallel-in Serial-out (PISO)
4. Parallel-in Parallel-out (PIPO)
Serial-in Serial-out (SISO):
This type of shift registers accepts data serially, i.e., one bit at a time on a single
input line. It produces the stored information on its single output and the output also in
serial form. Data may be shifted left (from low to high order bits) using shift-left register
or shifted right (from high to low order bits) using shift-right register.
Serial-in Parallel-out (SIPO):
It consists of one serial input, and outputs are taken from all the flip-flop
simultaneously in parallel. In this register, data is shifted in serially but shifted out in
parallel. In order to shift the data out in parallel, it is necessary to have all the data available
at the outputs at the same time. Once the data is stored, each bit appears on its respective
output line and all the bits are available simultaneously, rather than on a bit by bit basis as
with the serial output
Parallel-in Serial-out (PISO):
This type of shift register accepts data parallel, i.e., the bits are entered
simultaneously into their respective flip-flops rather than a bit-by-bit basis on one line.
Serial Input
CLK Serial Output
1 1 0
2 0 0
3 0 0
4 1 1
5 X 0
6 X 0
7 X 1
DATA OUTPUT
CLK
QA QB QC QD
1 1 1 0 0 0
2 0 0 1 0 0
3 0 0 0 1 1
4 1 1 0 0 1
CLK Q3 Q2 Q1 Q0 OUTPUT
0 1 0 0 1 1
1 0 0 0 0 0
2 0 0 0 0 0
3 0 0 0 0 1
Parallel In Parallel Out Shift Register:
2 1 0 1 0 1 0 1 0
Result:
Thus Shift registers are designed and their functions were verified.