DCD LAB Manual
DCD LAB Manual
MANUAL
1
Department of Electronics and Communication Engineering
To attract and retain knowledgeable, creative, motivated and highly skilled individuals
whose leadership and contributions uphold the college tenets of education, creativity,
research and responsible public service.
To develop faculty and resources to impart and disseminate knowledge and information
to students and also to society that will enhance educational level, which in turn, will
contribute to social and economic betterment of society.
To partner and collaborate with industry, government, and R and D institutes to develop
new knowledge and sustainable technologies and serve as an engine for facilitating the
nation’s economic development.
To impart personality development skills to students that will help them to succeed and
lead.
To instill in students the attitude, values and vision that will prepare them to lead lives of
personal integrity and civic responsibility.
To promote a campus environment that welcomes and makes students of all races,
cultures and civilizations feel at home.
Putting students face to face with industrial, governmental and societal challenges.
2
Department of Electronics and Communication Engineering
3
Department of Electronics and Communication Engineering
j) communicate effectively.
k) manage the projects keeping in view the economical and societal considerations.
l) recognize the need for adapting to technological changes and engage in life-long learning.
Course objectives:
After completion of this lab, students will get an idea of how to design, simulate and synthesize
various digital circuits. This course presents the students with a top down methodology for
digital circuit using a hardware description language (HDL). The objective is to develop students'
knowledge and expertise in the specialization of digital circuit design with HDL, and present the
techniques from an initial specification down to final implementation with FPGA for rapid
prototyping via top-down design methodology. The course is emphasized on hands-on exercises
of using state-of-the-art Electronic Design Automation (EDA) tools to the complete design of a
controller implemented with FPGA. The students will be equipped with the knowledge
necessary to design digital circuits for rapid prototyping using HDL.
Course outcomes:
After the completion of course, students will be able to
• learn the digital circuit concepts.
• design the digital circuits.
• develop digital circuits using CAD tools.
PSO2: apply the contextual knowledge of Electronics and Communication Engineering to assess
societal, environmental, health, safety, legal and cultural issues with professional ethics.components
4
Department of Electronics and Communication Engineering
taking into societal, environmental, health, safety, legal, cultural, ethical and economical
List of Experiments
5
Department of Electronics and Communication Engineering
INDEX
Page
S. No. Name of the Experiment
No.
Part-A
Part-B
8 Asynchronous counter. 26
6
Department of Electronics and Communication Engineering
PART-A
1. Full Adder
Aim:
To test the functionality of full adder using NAND gates.
Tools Required:
NI Multisim 14.0
Theory:
To construct a full adder circuit, we’ll need three inputs and two outputs. Since we’ll have both
an input carry and an output carry, we’ll designate them as CIN and COUT. At the same time, we’ll
use S to designate the final Sum output. The resulting truth table is shown to the right.
This is looking a bit messy. It looks as if C OUT may be either an AND or an OR function,
depending on the value of A, and S is either an XOR or an XNOR, again depending on the value
of A. Looking a little more closely, however, we can note that the S output is actually an XOR
between the A input and the half-adder SUM output with B and C IN inputs. Also, the output carry
will be true if any two or all three inputs are logic 1.
What this suggests is also intuitively logical: we can use two half-adder circuits. The first will
add A and B to produce a partial Sum, while the second will add C IN to that Sum to produce the
final S output. If either half-adder produces a carry, there will be an output carry. Thus, C OUT will
be an OR function of the half-adder Carry outputs. The resulting full adder circuit is shown here
7
Department of Electronics and Communication Engineering
Procedure:
1. Connect the circuit as shown in figure.
8
Department of Electronics and Communication Engineering
Experimental Setup
Precautions:
3) The Vcc and ground should be applied carefully at the specified pin only.
9
Department of Electronics and Communication Engineering
2. 8*1 Multiplexer
Aim:
To design and test the functionality of 8*1Mux using basic gates.
Tools Required:
NI Multisim 14.0
Theory:
The multiplexer or MUX is a digital switch, also called as data selector. It is a combinational
circuit with more than one input line, one output line and more than one select line. It allows the
binary information from several input lines or sources and depending on the set of select lines,
particular input line, is routed onto a single output line.
An 8-to-1 multiplexer consists of eight data inputs D0 through D7, three input select lines S2
through S0 and a single output line Y. Depending on the select lines combinations, multiplexer
decodes the inputs.
The below figure shows the block diagram of an 8-to-1 multiplexer with enable input that enable
or disable the multiplexer. Since the number data bits given to the MUX are eight then 3 bits
(23=8) are needed to select one of the eight data bits. An 8-to-1 multiplexer consists of eight data
inputs D0 through D7, three input select lines S2 through S0 and a single output line Y.
Depending on the select lines combinations, multiplexer decodes the inputs. The below figure
shows the block diagram of an 8-to-1 multiplexer with enable input that enable or disable the
multiplexer. Since the number data bits given to the MUX are eight then 3 bits (23=8) are needed
to select one of the eight data bits.
Logic Symbols & Function tables of ICs
10
Department of Electronics and Communication Engineering
Procedure:
1. Connect the circuit as shown in figure.
2. Apply Vcc & ground signal to every IC.
3. Observe the input & output according to the truth table.
11
Department of Electronics and Communication Engineering
Experimental Setup
U6B
VDD VDD
VDD
5.0V 5.0V
5.0V
74HC21D_4V
U6A
S2A S3A
S1A
Key = A Key = A
Key = A
74HC21D_4V
U2A
LED1
74HC21D_4V A
U2B
U1A U7A
U3A
74HC04D_4V 74HC04D_4V 74HC21D_4V
74HC04D_4V
U4A
74HC21D_4V
U8
1 U4B
Key = Space
74HC21D_4V
U5A
74HC21D_4V
U5B
Precautions:
3) The Vcc and ground should be applied carefully at the specified pin only.
12
Department of Electronics and Communication Engineering
Tools Required:
NI Multisim 14.0
Theory:
An SR Flip Flop is an arrangement of logic gates that maintains a stable output even after the
inputs are turned off. This simple flip flop circuit has a set input (S) and a reset input (R). The
set input causes the output of 0 (top output) and 1 (bottom output). The reset input causes the
opposite to happen (top = 1, bottom =0). Once the outputs are established, the wiring of the
circuit is maintained until S or R go high, or power is turned off to the circuit.
This is a simple model of how one bit of RAM can be perpetuated. There are many issues not
shown here such as timing inputs and synchronization, but the simplicity of the circuit gives you
an idea of how RAM operates
13
Department of Electronics and Communication Engineering
Explanation:
1. Q is set to 1 when the S input goes to logic 1.
2. This is remembered on Q after the S input returns to logic 0.
3. Q is reset set to 0 when the R input goes to logic 1.
4. This is remembered on Q after the R input returns to logic 0.
5. If both inputs are at logic 1, Q is the same as Q (the non-allowed state).
6. The state of the outputs cannot be guaranteed if the inputs change from 1,1 to 0, 0 at the
same time.
Procedure:
1. Connect the circuit as shown in figure.
2. Apply Vcc & ground signal to every IC.
3. Observe the input & output according to the truth table.
14
Department of Electronics and Communication Engineering
Experimental Setup
Precautions:
3) The Vcc and ground should be applied carefully at the specified pin only.
15
Department of Electronics and Communication Engineering
3. b) D Flip flop
Aim:
To test the functionality of D Flip flop using NAND gates.
Tools Required:
NI Multisim 14.0
Theory:
D flip flop is a better alternative that is very popular with digital electronics. They are commonly
used for counters and shift-registers and input synchronization. In a D flip flop, the output can be
only changed at the clock edge, and if the input changes at other times, the output will be
unaffected.
16
Department of Electronics and Communication Engineering
Procedure:
1. Connect the circuit as shown in figure.
2. Apply Vcc & ground signal to every IC.
3. Observe the input & output according to the truth table.
Experimental Setup
Precautions:
3) The Vcc and ground should be applied carefully at the specified pin only.
17
Department of Electronics and Communication Engineering
4. Shift Register
Aim:
To design and test the functionality of 4-bit shift register.
Tools Required:
NI Multisim 14.0
Theory:
In digital circuits, a shift register is a cascade of flip flops, sharing the same clock, in
which the output of each flip-flop is connected to the "data" input of the next flip-flop in the
chain, resulting in a circuit that shifts by one position the "bit array" stored in it, "shifting in" the
data present at its input and 'shifting out' the last bit in the array, at each transition of the clock
input.More generally, a shift register may be multidimensional, such that its "data in" and stage
outputs are themselves bit arrays; this is implemented simply by running several shift registers of
the same bit-length in parallel.
Shift registers can have both parallel and serial inputs and outputs. These are often
configured as "serial-in, parallel-out" (SIPO) or as "parallel-in, serial-out" (PISO). There are also
types that have both serial and parallel input and types with serial and parallel output. There are
also "bidirectional" shift registers which allow shifting in both directions: L→R or R→L.
Logic Diagram
18
Department of Electronics and Communication Engineering
Procedure:
1. Connect the circuit as shown in figure.
2. Apply Vcc & ground signal to every IC.
3. Observe the input & output according to the truth table.
Experimental Setup
Precautions:
3) The Vcc and ground should be applied carefully at the specified pin only.
19
Department of Electronics and Communication Engineering
5. Asynchronous Counter
Aim:
To design and test the functionality of 4-bit Asynchronous Counter.
Tools Required:
NI Multisim 14.0
Theory:
An Asynchronous counter can count using Asynchronous clock input. Counters can be easily
made using flip-flops. As the count depends on the clock signal, in case of an Asynchronous
counter, changing state bits are provided as the clock signal to the subsequent flip-flops. Those
Flip-flops are serially connected together, and the clock pulse ripples through the counter. Due to
the ripple clock pulse, it’s often called a ripple counter. An Asynchronous counter can count 2n –
1 possible counting states.
Logic Diagram
20
Department of Electronics and Communication Engineering
Procedure:
1. Connect the circuit as shown in figure.
2. Apply Vcc & ground signal to every IC.
3. Observe the input & output according to the truth table.
Experimental Setup
Precautions:
3) The Vcc and ground should be applied carefully at the specified pin only.
21
Department of Electronics and Communication Engineering
PART-B
Tools Required: Personal Computer with Xilinx ISE Design Software 14.2
Program:
module priorityencoder(
input [7:0] inp,
output reg[2:0] y
);
always @ (inp)
begin
casex (inp)
8'b00000001: y = 3'b000;
8'b0000001x: y = 3'b001;
8'b000001xx: y = 3'b010;
8'b00001xxx: y = 3'b011;
8'b0001xxxx: y = 3'b100;
8'b001xxxxx: y = 3'b101;
8'b01xxxxxx: y = 3'b110;
8'b1xxxxxxx: y = 3'b111;
default: y =3'bxxx;
endcase
end
endmodule
22
Department of Electronics and Communication Engineering
RTL Schematic:
23
Department of Electronics and Communication Engineering
7. RING COUNTER
Aim: To design a Ring Counter and simulation, synthesis has to be performed.
Tools Required: Personal Computer with Xilinx ISE Design Software 14.2
Program:
module ringcounter(
input clk,
input reset,
output reg [3:0] q
);
always @(posedge clk, posedge reset)
if(reset==1)
q<=4′b1000;
else
begin
q[3]<=q[0];
q[2]<=q[3];
q[1]<=q[2];
q[0]<=q[1];
end
endmodule
24
Department of Electronics and Communication Engineering
RTL Schematic:
25
Department of Electronics and Communication Engineering
8.ASYNCHRONOUS COUNTER
RTL Schematic:
26
Department of Electronics and Communication Engineering
9. Data path
Aim: To design a simple data path and simulation, synthesis has to be performed.
Tools Required: Personal Computer with Xilinx ISE Design Software 14.2
Block diagram:
Program:
Serial in Parallel out Register (SIPO) program:
module sipo( input clk, input reset, input sin, output [3:0] pout );
reg [3:0]temp;
always @ (posedge clk,posedge reset)
begin
if (reset==1'b1)
temp<=4'b0000;
else
begin
temp[3] <=sin;
temp[2]<=temp[3];
temp[1]<=temp[2];
temp[0]<=temp[1];
end
end
assign pout=temp;
endmodule
Parallel in Serial out (PISO) Register:
module piso( input clk, input reset, input load, input [3:0] pin, output reg sout );
reg [3:0] temp;
always @ (posedge clk, posedge reset,posedge load)
27
Department of Electronics and Communication Engineering
begin
if (reset ==1'b1)
sout <=1'b0;
else
if (load==1'b1)
temp<=pin;
else
begin
sout<=temp[3];
temp[3]<=temp[2];
temp[2]<=temp[1];
temp[1]<=temp[0];
end
end
endmodule
ALU:
module ALU( input [3:0] A, input [3:0] B, input [2:0] Control, output reg[3:0] Out, output
reg Cout );
28
Department of Electronics and Communication Engineering
RTL Schematic:
29
Department of Electronics and Communication Engineering
10. ALU
Tools Required: Personal Computer with Xilinx ISE Design Software 14.2
Program:
module alu(
input [7:0] A,B,
input [2:0] Control,
output reg [7:0] Out,
output reg Cout
);
always @ (A,B, Control)
begin
case(Control)
3'b000: {Cout,Out} = A+B;
3'b001: {Cout,Out} = A-B;
3'b010: Out = A*B;
3'b011: Out = A+1;
3'b100: Out = A|B;
3'b101: Out = A&B;
3'b110: Out = {A[7:0],1'b0};
3'b111: Out = {1'b0, A[7:1]};
endcase
end
endmodule
30
Department of Electronics and Communication Engineering
RTL Schematic:
31
Department of Electronics and Communication Engineering
32