Beruflich Dokumente
Kultur Dokumente
SYLLABUS
1. Design and implementation of Adders and Subtractors using logic gates. 2. Design and implementation of code converters using logic gates (i) BCD to excess-3 code and voice versa (ii) Binary to gray and vice-versa 3. Design and implementation of 4 bit binary Adder/ Subtractor and BCD adder using IC 7483 4. Design and implementation of 2Bit Magnitude Comparator using logic gates 8 Bit Magnitude Comparator using IC 7485 5. Design and implementation of 16 bit odd/even parity checker /generator using IC74180. 6. Design and implementation of Multiplexer and De-multiplexer using logic gates and study of IC74150 and IC 74154 7. Design and implementation of encoder and decoder using logic gates and study of IC7445 and IC74147 8. Construction and verification of 4 bit ripple counter and Mod-10 / Mod-12 Ripple counters 9. Design and implementation of 3-bit synchronous up/down counter 10. Implementation of SISO, SIPO, PISO and PIPO shift registers using Flip- flops. 11. Design of expts 1, 6,8,10 using Verilog HDL.
II Yr/ECE/147351/DE/LM
Page No.
LIST OF EXPERIMENTS
1. Study of logic gates. 2. Design and implementation of adders and Subtractors using logic gates. 3. Design and implementation of code converters using logic gates. 4. Design and implementation of 4-bit binary adder/Subtractor and BCD adder using IC 7483. 5. Design and implementation of 2-bit magnitude comparator using logic gates, 8-bit magnitude comparator using IC 7485. 6. Design and implementation of 16-bit odd/even parity checker/ generator using IC 74180. 7. Design and implementation of multiplexer and demultiplexer using logic gates and study of IC 74150 and IC 74154. 8. Design and implementation of encoder and decoder using logic gates and study of IC 7445 and IC 74147. 9. Construction and verification of 4-bit ripple counter and Mod10/Mod-12 ripple counter. 10. 11. Design and implementation of 3-bit synchronous up/down counter. Implementation of SISO, SIPO, PISO and PIPO shift registers using flip-flops.
II Yr/ECE/147351/DE/LM
Page No.
OR GATE:
II Yr/ECE/147351/DE/LM
Page No.
II Yr/ECE/147351/DE/LM
Page No.
II Yr/ECE/147351/DE/LM
Page No.
NOR GATE:
RESULT:
II Yr/ECE/147351/DE/LM
Page No.
EXPT.No: 2
SUM = AB + AB
CARRY = AB
II Yr/ECE/147351/DE/LM Page No. 7
II Yr/ECE/147351/DE/LM
Page No.
II Yr/ECE/147351/DE/LM
Page No.
Borrow = AB + BC + AC
II Yr/ECE/147351/DE/LM
Page No. 10
TRUTH TABLE:
A 0 0 0 0 1 1 1 1
B 0 0 1 1 0 0 1 1
C 0 1 0 1 0 1 0 1
BORROW DIFFERENCE 0 1 1 1 0 0 0 1 0 1 1 0 1 0 0 1
RESULT:
II Yr/ECE/147351/DE/LM
Page No. 11
II Yr/ECE/147351/DE/LM
Page No. 12
II Yr/ECE/147351/DE/LM
Page No. 13
G3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
G2 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
G1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0
G0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
II Yr/ECE/147351/DE/LM
Page No. 14
TRUTH TABLE: | |
G3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 G2 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 G1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 G0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 B3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 B2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 B1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 B0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Gray Code
Binary Code
II Yr/ECE/147351/DE/LM
Page No. 15
II Yr/ECE/147351/DE/LM
Page No. 16
II Yr/ECE/147351/DE/LM
Page No. 17
|
G3 0 0 0 0 0 1 1 1 1 1 x x x x x x
Excess 3 output
G2 0 1 1 1 1 0 0 0 0 1 x x x x x x G1 1 0 0 1 1 0 0 1 1 0 x x x x x x G0 1 0 1 0 1 0 1 0 1 0 x x x x x x
II Yr/ECE/147351/DE/LM
Page No. 18
E3 = B3 + B2 (B0 + B1)
II Yr/ECE/147351/DE/LM
Page No. 19
II Yr/ECE/147351/DE/LM
Page No. 20
E2 0 1 1 1 1 0 0 0 0 1
E1 1 0 0 1 1 0 0 1 1 0
E0 1 0 1 0 1 0 1 0 1 0
B3 0 0 0 0 0 0 0 0 1 1
B2 0 0 0 0 1 1 1 1 0 0
B1 0 0 1 1 0 0 1 1 0 0
B0 0 1 0 1 0 1 0 1 0 1
II Yr/ECE/147351/DE/LM
Page No. 21
K-Map for A:
A = X1 X2 + X3 X4 X1 K-Map for B:
II Yr/ECE/147351/DE/LM
Page No. 22
K-Map for C:
K-Map for D:
RESULT:
II Yr/ECE/147351/DE/LM
Page No. 23
EXPT.No: 4
II Yr/ECE/147351/DE/LM
Page No. 24
II Yr/ECE/147351/DE/LM
Page No. 25
0 1 0 0 1 1 1
1 1 0 0 0 0 0
K MAP
Y = S4 (S3 + S2)
II Yr/ECE/147351/DE/LM
Page No. 26
TRUTH TABLE:
S4 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 BCD SUM S3 S2 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 S1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 CARRY C 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1
RESULT:
II Yr/ECE/147351/DE/LM
Page No. 27
COMPARATOR
II Yr/ECE/147351/DE/LM
Page No. 28
II Yr/ECE/147351/DE/LM
Page No. 29
K MAP for A = B
II Yr/ECE/147351/DE/LM
Page No. 30
TRUTH TABLE A B 0000 0000 0000 0000 0001 0001 0000 0000 0000 0000 0001 0001 RESULT:
A>B 0 1 0
A=B 1 0 0
A<B 0 0 1
II Yr/ECE/147351/DE/LM
Page No. 31
/GENERATOR
FUNCTION TABLE: INPUTS Number of High Data Inputs (I0 I7) EVEN ODD EVEN ODD X X
PE 1 1 0 0 1 0
PO 0 0 1 1 1 0
OUTPUTS O E 1 0 0 1 0 1 0 1 1 0 0 1
II Yr/ECE/147351/DE/LM
Page No. 32
TRUTH TABLE:
I7 I6 I5 I4 I3 I2 I1 I0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0
I7I6I5I4I3I211 I0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0
Active 1 0 1
E 1 1 0
O 0 0 1
II Yr/ECE/147351/DE/LM
Page No. 33
TRUTH TABLE: E 1 0 1 O 0 1 0
I7 I6 I5 I4 I3 I2 I1 I0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0
I7 I6 I5 I4 I3 I2 I1 I0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0
Active 1 0 0
RESULT:
II Yr/ECE/147351/DE/LM
Page No. 34
FUNCTION TABLE:
S1 0 0 1 1
S0 0 1 0 1
INPUTS Y D0 D0 S1 S0 D1 D1 S1 S0 D2 D2 S1 S0 D3 D3 S1 S0
Y = D0 S1 S0 + D1 S1 S0 + D2 S1 S0 + D3 S1 S0
II Yr/ECE/147351/DE/LM
Page No. 35
II Yr/ECE/147351/DE/LM
Page No. 36
FUNCTION TABLE:
S1 0 0 1 1
S0 0 1 0 1
INPUT X D0 = X S1 S0 X D1 = X S1 S0 X D2 = X S1 S0 X D3 = X S1 S0
Y = X S1 S0 + X S1 S0 + X S1 S0 + X S1 S0
II Yr/ECE/147351/DE/LM
Page No. 37
II Yr/ECE/147351/DE/LM
Page No. 38
RESULT:
II Yr/ECE/147351/DE/LM
Page No. 39
II Yr/ECE/147351/DE/LM
Page No. 40
II Yr/ECE/147351/DE/LM
Page No. 41
II Yr/ECE/147351/DE/LM
Page No. 42
RIPPLE COUNTER AND MOD 10/MOD 12 RIPPLE COUNTER LOGIC DIAGRAM FOR 4 BIT RIPPLE UP COUNTER:
II Yr/ECE/147351/DE/LM
Page No. 43
II Yr/ECE/147351/DE/LM
Page No. 44
II Yr/ECE/147351/DE/LM
Page No. 45
TRUTH TABLE:
CLK 0 1 2 3 4 5 6 7 8 9 10
QA 0 1 0 1 0 1 0 1 0 1 0
QB 0 0 1 1 0 0 1 1 0 0 0
QC 0 0 0 0 1 1 1 1 0 0 0
QD 0 0 0 0 0 0 0 0 1 1 0
II Yr/ECE/147351/DE/LM
Page No. 46
II Yr/ECE/147351/DE/LM
Page No. 47
STATE DIAGRAM:
II Yr/ECE/147351/DE/LM
Page No. 48
LOGIC DIAGRAM:
QA TRUTH TABLE:
Input 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 QA 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 QB 1 1 0 0 1 1 0 0 0 1 1 0 0 1 1
QB
QC
QC 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
II Yr/ECE/147351/DE/LM
Page No. 49
RESULT:
II Yr/ECE/147351/DE/LM
Page No. 50
EXPT.No: 11
PIN DIAGRAM:
TRUTH TABLE:
CLK 1 2 3 4 5 6 7 Serial in 1 0 0 1 X X X Serial out 0 0 0 1 0 0 1
II Yr/ECE/147351/DE/LM
Page No. 51
LOGIC DIAGRAM:
TRUTH TABLE:
II Yr/ECE/147351/DE/LM
Page No. 52
OUTPUT DD 1 0 QA 1 1 QB 0 0 QC 0 1 QD 1 0
DA 1 1
DB 0 0
DC 0 1
VERILOG HDL PROGRAM HALF ADDER module ha(a,b,sum,carry); input a,b; output sum,carry; assign sum=a^b; assign carry=a&b; endmodule FULL ADDER module fa(a,b,cin,sum,cout); input a,b,cin; output sum,cout; assign sum=a^b^cin; assign cout=cin&(a&b)|(a&b); endmodule HALF SUBTRACTOR module hs(a,b,d,bout); input a,b; output d,bout; assign d=a^b; assign bout=~a&b; endmodule FULL SUBTRACTOR module fs(a,b,bin,d,bout); input a,b,bin; output d,bout; assign sum=a^b^bin; assign bout=bin&(~(a&b))|(~a&b); endmodule MULTIPLEXER module mux(s0,s1,d0,d1,d2,d3); input s0,s1; output y; input d0,d1,d2,d3; assign y=(~s0&~s1&d0)|(~s0&s1&d1)|(s0&~s1&d2)|(s0&s1&d3); endmodule
II Yr/ECE/147351/DE/LM
Page No. 54
DEMULTIPLEXER module demux(din,s0,s1,d0,d1,d2.d3); input din,s0,s1; output d0,d1,d2,d3; assign d0=(~s0&~s1&din); assign d1=(~s0&s1&din); assign d2=(s0&~s1&din); assign d3=(s0&s1&din); endmodule
COUNTERS
RIPPLE UP COUNTER module upcounter(clk,clr,q); input clk,clr; output [3:0]q; reg [3:0]q; reg [3:0]count=4b0000; always @(clk) begin if(clk==1b1) if(clr==1b1) count=4b0001; else count=count+4b0001; q=count; end endmodule RIPPLE DOWN COUNTER module upcounter(clk,clr,q); input clk,clr; output [3:0]q; reg [3:0]q; reg [3:0]count=4b1111; always @(clk) begin if(clk==1b1) if(clr==1b1) count=4b1111; else count=count-4b0001; q=count; end endmodule
II Yr/ECE/147351/DE/LM
Page No. 55
RIPPLE MOD-10 COUNTER module mod10(clk,reset,q); input clk,reset; output [3:0]q; reg [3:0]q=4b0000; always @(clk) begin if(reset) q=4b0000; else q=q+4b0001; if(q==4b1010) q<=4b0000; end endmodule RIPPLE MOD-12 COUNTER module mod12(clk,reset,q); input clk,reset; output [3:0]q; reg [3:0]q=4b0000; always @(clk) begin if(reset) q=4b0000; else q=q+4b0001; if(q==4b1100) q<=4b0000; end endmodule
II Yr/ECE/147351/DE/LM
Page No. 56
SHIFT REGISTER
SERIAL IN SERIAL OUT module siso(d,q,clk); input d,clk; output q; wire q1,q2,q0; dff dout(q,q2,clk); dff dff2(q2,q1,clk); dff dff1(q1,q0,clk); dff dff0(q0,d,clk); end module module dff(q,d,clk) input d,clk; output q; reg q; aiways@(posedge clk) q<=d; endmodule SERIAL IN PARALLEL OUT module sipo(clk,rst,din,dout); input clk,rst,din; output [3:0]dout; reg [3:0]dout; reg[2:0]x; always@(posedge(clk) or posedge(rst)) begin if(rst==1b1) dout=1bz; else begin x={x[2:0],din}; dout=x; end end endmodule
II Yr/ECE/147351/DE/LM
Page No. 57
PARALLEL IN SERIAL OUT module piso(clk,rst,din,dout,load); input clk; input rst; input [3:0]din; input load; output dout; reg dout; reg [4:0]x; always@(clk,rst) begin if(rst==1b1) dout=1bz; else begin if(load==1b1) x=din; x={x[3:0],1bz}; dout=x[3]; end end endmodule
PARALLEL IN PARALLEL OUT module pipo(clk,rst,din,dout); input clk,rst; input[3:0],din; output [3:0]dout; reg [3:0]dout; always@(clk,rst,din) begin if(rst==1b1) dout=1bz; else dout=din; end endmodule
II Yr/ECE/147351/DE/LM
Page No. 58