Professional Documents
Culture Documents
Lab Manual with output
Lab Manual with output
Lab Manual with output
Program Outcomes as defined by NBA (PO) 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.
Vision (College)
To nurture talent & enrich society through excellence in technical education, research &
innovation.
Mission (College)
1. To augment innovative Pedagogy & kindle quest for interdisciplinary learning & to
enhance conceptual understanding.
2. To build competence, professional ethics & develop entrepreneurial thinking.
3. To strengthen Industry Institute Partnership & explore global
Collaborations.
4. To inculcate culture of socially responsible citizenship.
5. To focus on Holistic & Sustainable development
Vision (Dept)
PART A
Design a 4 bit full adder and subtractor and simulate the same
2 CO2 PO3
using basic gates.
AIM:
To study about logic gates and verify their truth tables.
APPARATUS REQUIRED:
AND GATE:
SYMBOL: PIN DIAGRAM:
OR GATE:
NOT GATE:
SYMBOL: PIN DIAGRAM:
X-OR GATE :
SYMBOL : PIN DIAGRAM :
RESULT:
Date: Expt. Given a 4-variable logic expression, simplify it using appropriate
No.: technique and simulate the same
using basic gates
Assume a simple Boolean Expression
The values for the Y with the inputs P, Q, R are tabulated below.
P Q R
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
DESIGN A 4 BIT FULL ADDER AND SUBTRACTOR AND SIMULATE THE
Date: SAME USING BASIC GATES.
Expt. No.:
AIM:
To design and construct full adder and full subtractor circuits and verify the truth table using logic gates.
FULL ADDER:
Full adder is a combinational circuit which consists of three binary input variables called augends and
addends and two binary output variables called sum and carry out. In the addition result, the lower
significant bit is called as sum and the higher significant bit is called as carry out. The truth table of the full
adder describes all the eight possible input variations. The full adder results the outputs are equal to logic
‘0’ when all the applied inputs are equal to logic ‘0’ and the outputs are equal to logic ‘1’ when all the inputs
are equal to logic ‘1’. The sum is equal to 1 when odd numbers of inputs are equal to 1 from the applied
three inputs. The carry out is equal to 1 if more than one applied inputs are equal to 1.
TRUTH TABLE:
Inputs Outputs
A B Cin Cout S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
FULL SUBTRACTOR:
Full subtractor is a combinational circuit which consists of three binary input
variables called minuend and subtrahend, and two binary output variables called
difference and borrow out. In the subtraction result, the lower significant bit is called as
difference and the higher significant bit is called as barrow out. The truth table of the full
subtractor describes all the eight possible input variations. The full subtractor results the
outputs are equal to logic ‘0’ when all the applied inputs are equal to logic ‘0’.
TRUTH TABLE
Inputs Outputs
A B Bin Bout D
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 1 0
1 0 0 0 1
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
4-Bit Full Adder
//declare the inputs and outputs of the module with their sizes.
input [3:0] a,b;
input carry_in;
output [3:0] sum;
output carry;
//Internal variables
reg [4:0] sum_temp;
reg [3:0] sum;
reg carry;
endmodule
Date: Design Verilog HDL to implement Binary Adder-Subtractor – Half and Full
Adder, Half and Full Subtractor.
Expt. No.:
//Half Subtractor
module xor_gate(a1, b1, c1);
input a1, b1;
output c1;
assign c1 = a1 ^ b1;
endmodule
//Full Adder
module full_adder_s (
input a,b,cin,
output sum,carry
);
wire w1,w2,w3,w4; //Internal connections
xor(w1,a,b);
xor(sum,w1,cin); //Sum output
and(w2,a,b);
and(w3,b,cin);
and(w4,cin,a);
or(carry,w2,w3,w4); //carry output
endmodule
//Full Subtractor
module full_subtractor ( a ,b ,c ,diff ,borrow );
output diff ;
output borrow ;
input a ;
input b ;
input c ;
assign diff = a ^ b ^ c;
assign borrow = ((~a) & b) | (b & c) | (c & (~a));
endmodule
Digital Design and Computer Organization BCS302
Date: Expt. Design Verilog HDL to implement simple circuits using structural,
No.: Data flow and Behavioral model.
Structural Model:
// StructuralCircuit.v
module StructuralCircuit (
input A,
input B,
input C,
output Y
);
// Components
AND_gate u1 (.A(A), .B(B), .Y(Y_and));
OR_gate u2 (.A(Y_and), .B(C), .Y(Y));
Endmodule
Behavioral Model:
// BehavioralCircuit.v
module BehavioralCircuit (
input A,
input B,
input C,
output Y
);
reg YInternal;
// Behavioral assignment
always_comb begin
YInternal = A & B | C;
end
// Assign output
assign Y = YInternal;
endmodule
2:1 Multiplexer
// 2to1Mux.v
module TwoToOneMux (
input wire A, B,
input wire Sel,
output reg Y
);
always @* begin
Y = (Sel == 1'b0) ? A : B;
end
endmodule
//4:1 Multiplexer:
module FourToOneMux (
input wire [3:0] D,
input wire [1:0] Sel,
output reg Y
);
always @* begin
case (Sel)
2'b00: Y = D[0];
2'b01: Y = D[1];
2'b10: Y = D[2];
2'b11: Y = D[3];
default: Y = 1'b0; // Default case for safety
endcase
end
endmodule
8:1 Multiplexer:
// 8to1Mux.v
module EightToOneMux (
input wire [7:0] D,
input wire [2:0] Sel,
output reg Y
);
always @* begin
case (Sel)
3'b000: Y = D[0];
3'b001: Y = D[1];
3'b010: Y = D[2];
3'b011: Y = D[3];
3'b100: Y = D[4];
3'b101: Y = D[5];
3'b110: Y = D[6];
3'b111: Y = D[7];
default: Y = 1'b0; // Default case for safety
endcase
end
endmodule
1:2 De-Multiplexer:
// 1to2Demux.v
module OneToTwoDemux (
input wire D,
input wire Sel,
output reg Y0,
output reg Y1
);
always @* begin
Y0 = (Sel == 1'b0) ? D : 1'b0;
Y1 = (Sel == 1'b1) ? D : 1'b0;
end
endmodule
Date: Expt. Design Verilog program for implementing various types of Flip-Flops
No.: such as SR, JK and D.
//SR Flip-Flop:
// SRFlipFlop.v
module SRFlipFlop (
input S, R, CLK,
output reg Q, Qn
);
endmodule
//JK Flip-Flop:
// JKFlipFlop.v
module JKFlipFlop (
input J, K, CLK,
output reg Q, Qn
);
endmodule
D Flip-Flop:
// DFlipFlop.v
module DFlipFlop (
input D, CLK,
output reg Q, Qn
);
endmodule