Ec 452 DC & VHDL Lab Manual Final
Ec 452 DC & VHDL Lab Manual Final
DEPARTMENT OF ECE
CHALAPATHI INSTITUTE OF ENGINEERING AND TECHNOLOGY LAM, GUNTUR - 522034 (AFFILIATED TO ACHARYA NAGARJUNA UNIVERSITY)
LIST OF EXPERIMENTS
Experiments Based on Hardware 1. Generation and Detection of ASK. 2. Generation and Detection of FSK. 3. Generation and Detection of PSK. 4. Generation and Detection of TDM. 5. Generation and Detection of PCM VHDL Modeling and Synthesis of the Following Experiments 6. Logic Gates. 7. 4 bit Magnitude Comparator. 8. Multiplexers/Decoders. 9. JK, D & T Flip-Flops. 10. Synchronous Counters
1. GENERATION AND DETECTION OF AMPLITUDE SHIFT KEYING AIM: To generate and detect modulation and demodulation techniques by using ASK method. EQUIPMENTS: Kits for ASK modulation and demodulation. Patch Chords. Power supply. 20MHz Dual Trace Oscilloscope. PROCEDURE: 1. Refer to the block diagram and carry out the following connections and switch settings. 2. Connect power supply in proper polarity to the kits DCL-05 and DCL- 06 and switch it on. 3. Connect CLOCK and DATA generated on DCL-05 to CODING CLOCK IN and DATA INPUT respectively by means of the patch-chords provided. 4. Connect the NRZ-L data input to the CONTROL INPUT of the Carrier Modulator logic. 5. Connect carrier component SIN2 to INPUT1 and GROUND to INPUT2 of the Carrier Modulator Logic. 6. Connect ASK modulated signal MODULATOR OUTPUT on DCL-05 to the ASK IN of the ASK DEMODULATOR on DCL-06. 7. Observe various waveforms as mentioned below. PRECAUTIONS: 1. Keep the switch faults in off position. 2. Avoid loose connections
BLOCKDIAGRAM OF ASK:
WAVE FORMS:
RESULT:
BLOCKDIAGRAM OF FSK:
WAVE FORMS:
RESULT:
WAVE FORMS:
RESULT:
PRECAUTIONS: 7. Keep the switch faults in off position. 8. Avoid loose connections. BLOCK DIAGRAM OF TDM:
: WAVE FORMS:
RESULT:
11. Repeat the above experiment with DC Signal at the inputs of the Channel CH 0 and CH 1. 12. Connect ground points of both the kits with the help of connecting chord provided during all the experiments. BLOCK DIAGRAM:
WAVE FORMS :
RESULT:
GATE:
TRUTH TABLE:
A 0 1 A B NOT GATE A 0 0 1 1 B 0 1 0 1 C 1 0 0 1 1 0
EX-NOR GATE
library IEEE; use IEEE.STD_LOGIC_1164.all; entity andd is port( a : in STD_LOGIC; b : in STD_LOGIC; c : out STD_LOGIC ); end andd; architecture andd of andd is begin c<= a and b; end andd;
(ii)
OR GATE:
library IEEE; use IEEE.STD_LOGIC_1164.all; entity orr is port( a : in STD_LOGIC; b : in STD_LOGIC; c : out STD_LOGIC ); end orr; architecture orr of orr is begin c<= a or b; end orr; (iii) EX - OR GATE:
library IEEE; use IEEE.STD_LOGIC_1164.all; entity exorr is port( a : in STD_LOGIC; b : in STD_LOGIC; c : out STD_LOGIC ); end exorr; architecture exorr of exorr is begin c<= a xor b; end exorr;
(iv)
NAND GATE:
library IEEE; use IEEE.STD_LOGIC_1164.all; entity nandd is port( a : in STD_LOGIC; b : in STD_LOGIC; c : out STD_LOGIC ); end nandd; architecture nandd of nandd is begin c<= a nand b; end nandd;
(v)
NOR GATE:
library IEEE; use IEEE.STD_LOGIC_1164.all; entity norr is port( a : in STD_LOGIC; b : in STD_LOGIC; c : out STD_LOGIC ); end norr; architecture norr of norr is begin c<= a nor b; end norr;
(vi)
EX - NOR GATE:
library IEEE; use IEEE.STD_LOGIC_1164.all; entity exnorr is port( a : in STD_LOGIC; b : in STD_LOGIC; c : out STD_LOGIC ); end exnorr; architecture exnorr of exnorr is begin c<= a xnor b; end exnorr; (vii) NOT GATE: library IEEE; use IEEE.STD_LOGIC_1164.all; entity nott is port( a: in STD_LOGIC; b :out STD_LOGIC ); end nott; architecture nott of nott is begin b<= not a; end nott;
Waveforms:
Result:
Aim: To Design and Simulate 4 - Bit Magnitude Comparator. Software required: Active HDL 7.2 SE Block diagram:
4-BIT COMPARATOR
A [0:3] B [0:3] GT LT
EQ
Program: library IEEE; use IEEE.STD_LOGIC_1164.all; entity COMPARATOR is port( A : in STD_LOGIC_VECTOR(0 to 3); B : in STD_LOGIC_VECTOR(0 to 3); EQ : out STD_LOGIC; GT : out STD_LOGIC; LT : out STD_LOGIC ); end COMPARATOR; --}} End of automatically maintained section architecture COMPARATOR of COMPARATOR is begin -- enter your statements here -PROCESS (A,B) BEGIN IF A=B THEN EQ<= '1';GT<='0';LT<='0'; ELSIF A<B THEN EQ<= '0';GT<='0';LT<='1'; ELSIF A>B THEN EQ<= '0';GT<='1';LT<='0'; END IF; END PROCESS; end COMPARATOR; Waveforms:
Result:
Aim: To design and simulate 8x1 MUX and 2 to 4 DECODER Software required: Active HDL 7.2 SE Logic diagram: 8x1 MUX
Truth table:
Program: library IEEE; use IEEE.std_logic_1164.all; entity mux151 is port( D:in STD_LOGIC_VECTOR (7 downto 0); --8 i/p lines S :in STD_LOGIC_VECTOR (2 downto 0); --3 data select lines en_l:in STD_LOGIC;--active low enable i/p y :out STD_LOGIC--output line ); end mux151; architecture mux151 of mux151 is begin process(D,S ,en_l) begin if en_l='0' then case s is when"000" => y <= D(0); when"001" => y <= D(1); when"010" => y <= D(2); when"011" => y <= D(3); when"100" => y <= D(4); when"101" => y <= D(5); when"110" => y <= D(6);
when"111" => y <= D(7); when others=>null; end case; end if; end process; end mux151; 2 to 4 DECODER: Logic diagram:
Truth table:
Program:
library IEEE; use IEEE.STD_LOGIC_1164.all; entity decoder is port( EN : in STD_LOGIC; I : in STD_LOGIC_VECTOR(1 downto 0); Y : out STD_LOGIC_VECTOR(3 downto 0) ); end decoder; --}} End of automatically maintained section architecture decoder of decoder is begin -- enter your statements here -process(EN,I) begin if(EN='1') then if(I = "00") then y <= "0001" ; elsif(I = "01") then y <= "0010" ; elsif(I = "10") then y <= "0100" ; else y <= "1000" ; end if; else y <= "1111"; end if; end process; end decoder;
Waveforms:
Result:
Aim: To Design and Simulate D ,Jk And T- Flipflops . . Software required: Active HDL 7.2 SE Block diagram: D FLIP-FLOP
Truth Table:
Program:
library IEEE; use IEEE.STD_LOGIC_1164.all; entity dff is port( d : in STD_LOGIC; clk : in STD_LOGIC; Q : out STD_LOGIC ); end dff; architecture dff of dff is begin -- enter your statements here -process(d, clk) begin -- clock rising edge if (clk='1' and clk'event) then Q <= d; end if; end process; end dff; JK FLIP-FLOP
Truth table:
Program:
library IEEE; use IEEE.STD_LOGIC_1164.all; entity JKFF is port( clk : in STD_LOGIC; j : in STD_LOGIC; k : in STD_LOGIC; q : inout STD_LOGIC; qn : inout STD_LOGIC ); end JKFF; architecture JKFF of JKFF is begin -- enter your statements here -process(clk,j,k) begin if (clk='1' and clk'event) then if(j='0' and k='0') then q<=q;qn<=qn ; elsif(j='0' and k='1') then q<='0';qn<='1' ; elsif(j='1' and k='0') then q<='1';qn<='0' ; elsif(j='1' and k='1') then q<=not q;qn<=q ; end if; end if; end process; end JKFF;
T FLIP-FLOP:
Truth table:
Characteristic table
Excitation table
T Q Qnext
Comment
Qnext
Comment
0 0
No change
0 1
No change
1 0
toggle
Complement
1 1
toggle
Complement
entity tff is port( clk : in STD_LOGIC; t : in STD_LOGIC; q : inout STD_LOGIC ); end tff; architecture tff of tff is begin -- enter your statements here -process(clk,t) begin q<='0'; if (clk='1' and clk'event) then if(t='0') then q<=q ; elsif(t='1') then q<=not q; end if; end if; end process; end tff;
Result:
QC 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
QB 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
QA 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 0
UP/DOWN 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
QC 1 0 0 0 0 0 0 1 0 1 1 1 1 1 1 0
QB 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0
QA 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0
use ieee.std_logic_unsigned.all; entity counter is port( clk : in STD_LOGIC; reset : in STD_LOGIC; up_down : in STD_LOGIC; Q : out STD_LOGIC_VECTOR(0 to 2) ); end counter; architecture counter of counter is --begin -- enter your statements here -signal count :std_logic_vector (0 to 2); begin process (clk, reset) begin if (reset = '1') then count <= (others=>'0'); elsif (clk='1' and clk'event) then if (up_down = '1') then count <= count + 1; else count <= count - 1; end if; end if; end process; Q <= count;
Result: