Dlda - It
Dlda - It
Aim: To study basic logic gates and derived logic gates on IC’s .
Theory: Gate is a logic circuit with one or more inputs but only one output. Gates are digital
(two state) circuit because the input & output are either low or high.Gates provide high
output for certain combinations of input & for other combinations the output is low.
OR gate: The OR gate has two or more inputs but only 1 output. If any or all the inputs are
high, the output is high. If all the inputs are low, the output is low.
AND gate: The AND gate has two or more inputs but only one output. If any or all inputs are
high then output is also high
NOT gate: The Not gate is a gate with only one input and one output. The output is always in
opposite state of an input. A NOT gate is also called as Inverter because it performs inversion.
EX-OR gate : The EX-OR gate has two or more inputs but only one output. For odd no of ones
as a input output of EX-OR gate is high.
NOR gate : The NOR gate has two or more inputs but only one output.If any of its input is
HIGH then it will give LOW output and only when all of its inputs are LOW the output is HIGH
EX-NOR gate : The EX-NOR gate has two or more inputs but only one output. For even no of
ones or all zeroes the output of this gate is high.
NAND gate : The NAND gate has two or more inputs but only one output. When any of the
input is low the output will be high.
Conclusion :
Theory: For subtraction of one binary number from another, we do so by adding 2’s
complement of the former to the latter number using a full adder circuit.IC 7483 is a 16
pin, 4-bit full adder. This IC has a provision to add the carry output to transfer and end
around carry output using Co and C4 respectively. Pin diagram is as shown in fig. 2’s
complement: 2’s complement of any binary no. can be obtained by adding 1 in 1’s
complement of that no.
In 2’s complement subtraction using IC 7483, we are representing negative number in 2’s
complement form and then adding it with 1st number. Circuit connection is as shown in fig.
Procedure:
7 0111 0111
2 0010 + 1110
1C of 2 1101 1 0101
+1
2C of 2 1110
PIN Diagram:
Logic Diagram:
Conclusion :
Theory: IC 7485 is a 4-bit comparator. It compares two 4-bit words. Three fullydecoded
decisions (A > B, A < B, and A = B) about two, 4-bit words (A, B) are made and
are
externally available at three outputs. These devices are fully expandable to any
number of bits without external gates. Words of greater length may be compared
by connecting comparators in cascade.The A > B, A < B, and A = B outputs of a
stage handling less-significant bits are connected to the corresponding inputs of
the next stage handling more significant bits.The stage handling the least-
significant bits must have a high-level voltage applied to the A = B input as shown
Pin Diagram:
Logic Diagram:
Comparison Table:
A=B 1 0 0 1 0 0
1 0 1 0 0 0
X 1 0 1 1 0
A>B X X X 0 0 1
Conclusion:
EXPERIMENT NO 4 : - MULTIPLEXER
Theory : Multiplexer is a digital switch. It allows digital information from several sources to
be routed onto a single output line. The basic multiplexer has several data-input
lines and a single output line. The selection of particular input line is controlled by
a set of selection lines. Normally, there are 2n input lines and n selection lines
whose bit combinations determine which input is selected. Therefore, multiplexer
is ‘many into one’ and it provides the digital equivalent of an analog selector switch.
Truth table
Input Output
Select Enable
A B C EN Y Y
X X X 1 0 1
0 0 0 0 D0 D0
0 0 1 0 D1 D1
0 1 0 0 D2 D2
0 1 1 0 D3 D3
1 0 0 0 D4 D4
1 0 1 0 D5 D5
1 1 0 0 D6 D6
1 1 1 0 D7 D7
Logic Diagram :
Pin Diagram :
Conclusion :
Theory : There is a wide variety of binary codes used in digital systems. Some of these codes are
binary-coded-decimal (BCD), Excess-3, gray, and so on. Many times it is required to convert one
code to another. That’s why we used code converter.
Here we study about Gray to Binary and Binary to Gray code converter.
The gray code is often used in digital systems because it has the advantage that only one bit in
the numerical representation changes between successive numbers.
Binary To Gray
10 1 0 1 0 1 1 1 1
11 1 0 1 1 1 1 1 0
12 1 1 0 0 1 0 1 0
13 1 1 0 1 1 0 1 1
14 1 1 1 0 1 0 0 1
15 1 1 1 1 1 0 0 0
Note: Draw k map for G0, G1, G2, G3 and write equations for each. And draw logic diagram for
binary to gray code converter.
Gray To Binary :
Note: Draw k map for B0, B1, B2, B3 and write equations for each. And draw logic diagram for
gray TO binary code converter.
Conclusion :
EXPERIMENT NO 6 : - FLIP-FLOPS
Aim: To study flip flops (J-K, D, and T flip flop) using IC 7476.
Theory: "Flip-flop" is the common name given to two-state devices which offer basic
memory for sequential logic operations. Flip-flops are heavily used for digital data
storage and transfer and are commonly used in banks called "registers" for the
storage of binary numerical data.
JK Flip Flop: JK-flip flop has two inputs, traditionally labeled J and K. IC 7476 is a dual JK
master slave flip flop with preset and clear inputs. If J and K are different then the
output Q takes the value of J at the next clock edge. If J and K are both low then no change
occurs. If J and K are both high at the clock edge then the output will toggle from one state to the
other. It can perform the functions of the set/reset flip-flop and has the advantage that there are
no ambiguous states.
D Flip Flop: D flip-flop tracks the input, making transitions with match those of the input D.
The D stands for "data"; this flip-flop stores the value that is on the data line. It can
be thought of as a basic memory cell. D flip-flop can be made from J-K flipflop by connecting
both inputs through a not gate as shown in fig.
T Flip Flop: T or "toggle" flip-flop changes its output on each clock edge, giving an output
which is half the frequency of the signal to the T input. It is useful for constructing
binary counters, frequency dividers, and general binary addition devices. It can be made from a
J-K flip-flop by tying both of its inputs high.
Observations :
D O/P
0 0
1 1
J-K Flip-flop
Q J K Qn+1 Q n+1
0 0 0 0 1
0 0 1 0 1
0 1 0 1 0
0 1 1 1 0
1 0 0 1 0
1 0 1 0 1
1 1 0 1 0
1 1 1 0 1
T Flip-flop
T O/P
0 Qn
1 Qn
Pin Diagram :
Conclusion :
Theory: IC 7490: The 7490 integrated circuit counts the number of pulses arriving at its
input. The number of pulses counted (up to 9) appears in binary form on four pins
of the ic. When the tenth pulse arrives at the input, the binary output is reset to
zero (0000) and a single pulse appears at another output pin. So for ten pulses in
there is one pulse out of this pin. The 7490 therefore divides the frequency of the
input by ten. If this pulse is applied to the input of a second 7490 then this second
ic will count the pulses from the first ic. It will give one pulse out after 100 pulses
have been applied to the first ic. The 7490 can be connected to divide by other
values.
Decimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
IC 7493: These are ripple counters so beware that glitches may occur in any logic gate
systems connected to their outputs due to the slight delay before the later counter
outputs respond to a clock pulse. The count advances as the clock input becomes
low (on the falling-edge), this is indicated by the bar over the clock label. This is
the usual clock behavior of ripple counters and it means a counter output can
directly drive the clock input of the next counter in a chain.
The counter is in two sections: clockA-QA and clockB-QB-QC-QD. For normal use
connect QA to clockB to link the two sections, and connect the external clock signal to clockA.
For normal operation at least one reset0 input should be low, making both high
resets the counter to zero (0000, QA-QD low). Note that the 7490 has a pair of reset9 inputs on
pins 6 and 7, these reset the counter to nine (1001) so at least one of them must be low for
counting to occur.
Pin Diagram :
Conclusion :
Theory: VHDL is stands for ‘Very High Speed Integrated circuit Hardware Description
Language’. It is inherently parallel i.e. commands which responds to logic gate are
executed to parallel as soon as input arrives. Level of Representation and Abstraction:
The highest level of abstraction to the behavioral level that decribes the system in terms of its
components and interconnection between them. A behavioral description specifies the
relationship between the input and output. The structural level describes that are interconnected
to perform a desired task. A structural description can be compared to a schematic of
interconnected logic gates.
Entity declaration:The entity declaration defines the name of entity and lists the inputs and
outputs.
Entity NAME_OF_ENTITY is
Port(signal name : mode type;
___;
___;
___);
end ENTITY_NAME;
The architecture body specifies how the circuit operates and how it is
implemented. The architecture body tools_
a process is declared within an architecture and is a concurrent statement. However the statement
inside a process is executes sequentially. A process reads and writes signals and values if the
interface port to indicate root of architecture.
Library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following lines to use the declaration that are provided for
-- instantiating Xilink Primitive components.
-- library UNISIM;
-- use UNISIM.VComponents.all;
entity logic_gates is
Port(a: in std_logic;
b: in std_logic;
c: out std_logic;
d: out std_logic;
e: out std_logic);
end logic_gates;
architecture Behavioral of logic_gates is
begin
c<= not a;
d<= a and b;
e<= a or b;
end Behaviral;
Conclusion:
Aim: Implementation of 4:1 MUX using VHDL and Simulation using ModelSim
Theory: VHDL is stands for ‘Very High Speed Integrated circuit Hardware Description
Language’. It is inherently parallel i.e. commands which responds to logic gate are
executed to parallel as soon as input arrives. Level of Representation and Abstraction:
The highest level of abstraction to the behavioral level that decribes the system in terms of its
components and interconnection between them. A behavioral description specifies the
relationship between the input and output. The structural level describes that are interconnected
to perform a desired task. A structural description can be compared to a schematic of
interconnected logic gates.
Entity declaration:The entity declaration defines the name of entity and lists the inputs and
outputs.
Entity NAME_OF_ENTITY is
Port(signal name : mode type;
___;
___;
___);
end ENTITY_NAME;
The architecture body specifies how the circuit operates and how it is
implemented. The architecture body tools_
a process is declared within an architecture and is a concurrent statement. However the statement
inside a process is executes sequentially. A process reads and writes signals and values if the
interface port to indicate root of architecture.
4:1 MUX : In 4:1 MUX no. of data inputs are n=4, no. of select lines are m=2 so that
2m=n and 1 output. A 4:1 multiplexer is shown in figure below, each of 4 input lines DI0 to DI3
is applied to one input of an AND gate. Selection lines S0 and S1 are decoded to select a
particular AND gate. The truth table for the 4:1 MUX is given in the table below.
Logic:
1) For the implementation of 4:1 MUX using VHDL, according to the truth
table, we take four variables for data input, two variables for select line and one
variable for output. Assigned one of the data input to output depending upon the
combination of select lines.
o o
S1 S0 Y
D0 0 0 D0
0 1 D1
D1 1 0 D2
Y 1 1 D3
D2
D3
Library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following lines to use the declaration that are provided for
-- instantiating Xilink Primitive components.
-- library UNISIM;
-- use UNISIM.VComponents.all;
entity mux is
Port(d: in std_logic_vector(3 downto 0)
s: in std_logic_vector(1 downto 0)
y: out std_logic);
end mux;
architecture Behavioral of mux is
begin
y<=d(0) when s=”00” else
d(1) when s=”01” else
d(2) when s=”10” else
d(3) when s=”11”;
end Behaviral;
Conclusion :
Theory: VHDL is stands for ‘Very High Speed Integrated circuit Hardware Description
Language’. It is inherently parallel i.e. commands which responds to logic gate are
executed to parallel as soon as input arrives. Level of Representation and Abstraction:
The highest level of abstraction to the behavioral level that decribes the system in terms of its
components and interconnection between them. A behavioral description specifies the
relationship between the input and output. The structural level describes that are interconnected
to perform a desired task. A structural description can be compared to a schematic of
interconnected logic gates.
Entity declaration:The entity declaration defines the name of entity and lists the inputs and
outputs.
Entity NAME_OF_ENTITY is
Port(signal name : mode type;
___;
___;
___);
end ENTITY_NAME;
The architecture body specifies how the circuit operates and how it is
implemented. The architecture body tools_
a process is declared within an architecture and is a concurrent statement. However the statement
inside a process is executes sequentially. A process reads and writes signals and values if the
interface port to indicate root of architecture
Synchronuos Counter: Digital circuit used for counting pulses is known as counter. It is a
4-bit Synchronous Counter: In synchronous counter clock pulse is applied to all flip flops
separately which drives each flip flop. In 4-bit synchronous
counter there are 4 flip flops which counts 0000 to 1111 on application of clock pulse. The
circuit diagram is as shown. This concept is used to design it using VHDL.
Logic: To implement the 4-bit synchronous counter using VHDL, we need one variable for
clock pulse which changes between 0 and 1 after specific time duration. Then 4 variable
for 4 bits and one variable to reset the counter.
Library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following lines to use the declaration that are provided for
-- instantiating Xilink Primitive components.
-- library UNISIM;
-- use UNISIM.VComponents.all;
entity sync_4 is
Port(clk: in std_logic;
q: out std_logic_vector(3 downto 0)
clr: in std_logic;
ld: in std_logic;
enp: in std_logic;
ent: in std_logic;
tc: out std_logic);
end sync_4;
architecture Behavioral of sync_4 is
signal q_s: std_logic_vector(3 downto 0);
begin
process(clk)
begin
if(clk’event and clk=’1’ and clr=’0’)
then q_s<=”0000”;
end if;
if(ent=’1’ and enp=’1’ and clk=’1’)then
q_s<=q_s+1;
end if;
if(q_s=”1111” and ent=’1’ and enp=’1’)
then tc<=’0’;
end if;
end process;
q<=q_s;
end Behaviral;
Conclusion :