BCS302_DD-and-CO-Lab-Mannual.-17069398601480.pdf
BCS302_DD-and-CO-Lab-Mannual.-17069398601480.pdf
BCS302_DD-and-CO-Lab-Mannual.-17069398601480.pdf
Approved By:
Dr. Kala Venugopal
Head of Department Information Science and Engineering
MISSION OF INSTITUTE
LABORATORY OBJECTIVES
Course Objective:
● To understand the working of simulide simulator.
These are sample Strategies; that teachers can use to accelerate the attainment of the various
course outcomes.
PSO1: Able to apply knowledge of information management and communication systems to provide secured
solutions for real time engineering applications.
PSO2: Apply best software engineering practices, modern tools and technologies to deliver quality products.
PROGRAM OUTCOMES (POs)
Engineering Graduates will be able to:
1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals, and an
engineering specialization to the solution of complex engineering problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex engineering problems
reaching substantiated conclusions using first principles of mathematics, natural sciences, and engineering
sciences.
3. Design/development of solutions: Design solutions for complex engineering problems and design system
components or processes that meet the specified needs with appropriate consideration for the public health and
safety, and the cultural, societal, and environmental considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and research methods
including design of experiments, analysis and interpretation of data, and synthesis of the information to provide
valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern engineering and
IT tools including prediction and modeling to complex engineering activities with an understanding of the
limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal, health,
safety, legal and cultural issues and the consequent responsibilities relevant to the professional engineering
practice.
7. Environment and sustainability: Understand the impact of the professional engineering solutions in societal
and environmental contexts, and demonstrate the knowledge of, and need for sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the
engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or leader in diverse
teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the engineering
community and with society at large, such as, being able to comprehend and write effective reports and design
documentation, make effective presentations, and give and receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the engineering and
management principles and apply these to one’s own work, as a member and leader in a team, to manage projects
and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in independent
and life-long learning in the broadest context of technological change.
COURSE OUTCOMES
The internals marks of lab for 2022 scheme is 15 Marks for Continuous Evaluation and 10 Marks for Lab Internals.
Continuous Evaluation for 2022 scheme:
Sl Parameters Mark 5 4 3 0
No
1. Writing Program/Logic 5 The student is The student is The student has The student is
(present able to write able to write the written not attempted
week’s/previous the program program with incomplete to write
week’s) without any minor logical program with program.
logical and error major logical
syntactical and syntactical
error and error
proper
indentation is
followed.
2. Implementation in the 5 Student is able Student is able Student is The student
target language with to execute, to execute the executed the has not
different inputs debug, and test program, but program executed the
the program for fails to debug, partially(fails to program.
all possible and test the meet desired
inputs/test program for all output)
cases. possible
inputs/test
cases.
Parameters 3 3 2 1 0
3. Record 3 Student Student submits Student fails to The student
submits the the record on submit the does not
record on time time but not record on time . submit the
and, neatly documented record.
documented properly with all
with all possible
possible input/output
input/output samples.
samples.
Parameters 2 2 1.5 1 0
4. Viva 2 Student Student answers Student Student fails
answers for for atleast 60% answers for to answer any
atleast 80% of of questions atleast 40% of question
questions questions
5. Internal Assessment 10
PRACTICAL COMPONENT OF IPCC :
Sl.NO Experiments
Given a 4-variable logic expression, simplify it using appropriate technique and simulate the same
1
using basic gates.
2 Design a 4 bit full adder and sub tractor and simulate the same using basic gates.
3 Design Verilog HDL to implement simple circuits using structural, Data flow and Behavioral model.
Design Verilog HDL to implement Binary Adder-Sub tractor – Half and Full Adder, Half and Full
4
Sub tractor.
6 Design Verilog program to implement Different types of multiplexer like 2:1, 4:1 and 8:1.
8 Design Verilog program for implementing various types of Flip-Flops such as SR, JK and D.
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
LAB PROGRAMS
1. Given a 4-variable logic expression, simplify it using appropriate technique
and simulate the same using basic gates.
F(A,B,C,D) = ∑m(0,2,4,5,6,7,8,10,11,12,14,15)
A B C D F
0 0 0 0 1
0 0 0 1 0
0 0 1 0 1
0 0 1 1 0
0 1 0 0 1
0 1 0 1 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 1`
1 0 0 1 0
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 0
1 1 1 0 1
1 1 1 1 1
Simplified expression if F(A,B,C,D) = D’ + A’B + AC
KMAP :
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
F
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
2. Design a 4 bit full adder and subtractor and simulate the same using basic
gates
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
Structural :
Dataflow :
Behavioral :
module andgate(Y,A,B);
input A,B;
output Y;
reg Y;
always @ (A or B)
begin
if(A ==1 && B == 1)
Y = 1;
else
Y = 0;
end
endmodule
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
Half Adder:
INPUT OUTPUT
COU
A B SUM
T
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Half subtractor:
INPUT OUTPUT
A B DIFF BC
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
Full adder:
module full_adder(input a,b,c,output sum,cout);
assign sum = (a ^ b ^ c );
assign cout = (a & b ) | (b & c) | (a & c);
endmodule
INPUT OUTPUT
C COU
A B SUM
T
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
Full subtractor :
INPUT OUTPUT
A B C DIFF BR
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
module bcdadder(a,b,carry_in,sum,carry);
input [3:0]a,b;
input carry_in;
output[3:0]sum;
output carry;
reg[4:0]sum_temp;
reg[3:0]sum;
reg carry;
always @ (a,b,carry_in)
begin
sum_temp = a+b+carry_in;
if(sum_temp > 9)
begin
sum_temp = sum_temp + 6;
carry = 1;
sum = sum_temp[3:0];
end
else
begin
carry = 0;
sum = sum_temp[3:0];
end
end
endmodule
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
2:1 MUX :
module mux2to1(D0, D1, S, Y);
output Y;
input D0, D1, S;
assign Y=(D0 & ~S) | (D1 & S);
or
assign Y=(S)? D1:D0;
endmodule
INPUT OUTPUT
S Y
0 D0
1 D1
4:1 MUX :
INPUT OUTPUT
S0 S1 Y
0 0 D0
0 1 D1
1 0 D2
1 1 D3
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
8:1 MUX :
module mux8to1(output Y, input D0, D1, D2, D3, D4, D5, D6, D7, S0, S1,
S2);
assign Y = (D0 & ~S0 & ~S1 & ~S2) | (D1 & ~S0 & ~S1 & S2) | (D2 &
~S0 & S1 & ~S2) | (D3 & ~S0 & S1 & S2) | (D4 & S0 & ~S1 & ~S2) | (D5
& S0 & ~S1 & S2) | (D6 & S0 & S1 & ~S2) | (D7 & S0 & S1 & S2);
endmodule
INPUT OUTPUT
S0 S1 S2 Y
0 0 0 D0
0 0 1 D1
0 1 0 D2
0 1 1 D3
1 0 0 D4
1 0 1 D5
1 1 0 D6
1 1 1 D7
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
1:8 DEMUX :
module demux1to8(d,s0,s1,s2,d0,d1,d2,d3,d4,d5,d6,d7);
input s,s0,s1,s2;
output d0,d1,d2,d3,d4,d5,d6,d7;
assign d0 = (d & ~s0 & ~s1 & ~s2),
d1=(d & ~s0 & ~s1 & s2),
d2=(d & ~s0 & s1 & ~s2),
d3=(d & ~s0 & s1 & s2),
d4=(d & s0 & ~s1 & ~s2),
d5=(d & s0 & ~s1 & s2),
d6=(d & s0 & s1 & ~s2),
d7=(d & s0 & s1 & s2);
endmodule
INPUT OUTPUT
s0 s1 s2 d0 d1 d2 d3 d4 d5 d6 d7
0 0 0 d 0 0 0 0 0 0 0
0 0 1 0 d 0 0 0 0 0 0
0 1 0 0 0 d 0 0 0 0 0
0 1 1 0 0 0 d 0 0 0 0
1 0 0 0 0 0 0 d 0 0 0
1 0 1 0 0 0 0 0 d 0 0
1 1 0 0 0 0 0 0 0 d 0
1 1 1 0 0 0 0 0 0 0 d
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
1:4 demux :
module demux1to4(d,s0,s1,d0,d1,d2,d3);
input d,s0,s1;
output d0,d1,d2,d3;
assign d0 = (d & ~s0 & ~s1),
d1 = (d & ~s0 & s1),
d2 = (d & s0 & ~s1),
d3 = (d & s0 &s1);
endmodule
INPUT OUTPUT
s0 s1 d0 d1 d2 d3
0 0 d 0 0 0
0 1 0 d 0 0
1 0 0 0 d 0
1 1 0 0 0 d
1:2 demux :
module demux1to2(d,s,d0,d1);
input d,s;
output d0,d1;
assign d0 = (d & ~s),
d1 = (d & s);
endmodule
INPUT OUTPUT
s d0 d1
0 d O
1 0 d
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
module dff(D,CLK,Q);
input D, CLK;
output Q;
reg Q;
always @(posedge CLK)
begin
Q <= D;
end
endmodule
INPUT OUTPUT
COMMENTS
CLK D Q
↑ D D Q=D
NO
X D Q
CHANGE
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
SR FLIPFLOP :
module SR_flipflop ( input clk, rst_n, input s,r,output reg q,output q_bar )
always@(posedge clk) begin
if(!rst_n) q <= 0;
else begin
case({s,r})
2'b00: q <= q;
2'b01: q <= 1'b0;
2'b10: q <= 1'b1;
2'b11: q <= 1'bx;
endcase
end
end
assign q_bar = ~q;
endmodule
INPUT OUTPUT
COMMENTS
clk s r q
↑ 0 0 Q NO CHANGE
↑ 0 1 0 RESET
↑ 1 0 1 SET
↑ 1 1 x FORBIDDEN
Digital Design & Computer Organization Dept. of ISE, AcIT, Bangalore
INPUT OUTPUT
COMMENTS
clk j k q
↑ 0 0 Q NO CNANGE
↑ 0 1 0 0
↑ 1 0 1 1
↑ 1 1 q’ TOGGLE