You are on page 1of 6

VLSI DESIGN (EC302)

TERM ASSIGNMENT
REPORT

SUBMITTED BY
HARIKRISHNAN.P CB107EI023

NISHANTH V.MENON CB107EI042

T M VAMSI PRRETHAM CB107EI066

VISHNU.A CB107EI072
LAMP HANDBALL

Lamp handball is nothing but the electronic model of Handball. This basically makes
use of bidirectional shift registers with parallel load. This application also shows the
operation of asynchronous inputs of flip-flops.

How is the game played?

Here the light is the ball. The rate at which the light moves is determined by the frequency of
the clock. The light is shifted from right to left by the shift register. Here 8 indicator lamps
are used to signify the movement of the light.

A start switch starts the game by placing the ball at the rightmost end. When the
player presses the pulser switch the ball starts moving towards the left. Once the light moves
and reaches the leftmost end it is moved back to the right end by a change in direction of the
shift register.

Now the player has the light in his region of control. When the ball reaches the right
end the player has to press the pulser switch to change the direction of the light.

If the player presses the button too soon or too late the light goes off and he loses. The
game can be restarted by turning the start switch on. To make the game more challenging the
frequency of the clock could be made high.

Here we have considered a 16 bit universal shift register and which gets triggered by a
clock signal. In this 16 bit register we make use of only the last eight LSB’s. 16 bit register is
generally used to decrease the clock frequency while using FPGA which is generally 27MHz.
-------------------------------------------------------------------------
----------------------LAMP
HANDBALL---------------------------------------------------------
-------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
--------------PIN INITIALIZATIION OF THE CIRCUIT--------------
entity ty2 is
port (clk : in std_logic;
ck1:in std_logic;
star:in std_logic;
out_data12 : out std_logic_vector(16 downto 1));
end ty2;
--------------OPERATION OF THE CIRCUIT----------------
architecture ty2_arch of ty2 is
signal temp2: std_logic_vector(16 downto 1);
signal d1 : std_logic_vector(2 downto 1);
signal mode1 :std_logic_vector(2 downto 1);
signal a:std_logic;
begin
process(temp2,d1,mode1,a,star,clk,ck1)
begin
----------------SET AND RESET----------------
if (star='1') then
temp2<="0000000000000000";
mode1<="00";
a<='1';
elsif(star='0') then
if (a='1') then
temp2<="0000000000000001";
a<='0';
else
temp2<=temp2;
end if;
end if;
---------------------STARTING THE GAME-------------------------
if (star='0')then
d1(2)<=temp2(16);
d1(1)<=temp2(1);
end if;
if(ck1='1')then
if(d1="00")then
mode1<="11";
elsif(d1="01")then
mode1<="10";
elsif(d1="11") then
mode1<="00";
end if;
end if;
if(clk='1')then
if(clk'event)then
if(mode1(2)='0' and mode1(1)='0')then
temp2<=temp2;
elsif(mode1(2)='0' and mode1(1)='1')then
-- for i in 1 to 7 loop
--temp2(i)<=temp2(i+1); SHIFTING TO THE RIGHT
-- end loop;
temp2(1)<=temp2(2);
temp2(2)<=temp2(3);
temp2(3)<=temp2(4);
temp2(4)<=temp2(5);
temp2(5)<=temp2(6);
temp2(6)<=temp2(7);
temp2(7)<=temp2(8);
temp2(8)<=temp2(9);
temp2(9)<=temp2(10);
temp2(10)<=temp2(11);
temp2(11)<=temp2(12);
temp2(12)<=temp2(13);
temp2(13)<=temp2(14);
temp2(14)<=temp2(15);
temp2(15)<=temp2(16);

temp2(16)<='0';
if(ck1='1')then
if(temp2(2)='1')then
mode1<="10";
end if;
end if;
elsif(mode1(2)='1' and mode1(1)='0')then
--for i in 2 to 8 loop
-- temp2(i)<=temp2(i-1); SHIFTING TO THE LEFT
--end loop;
temp2(2)<=temp2(1);
temp2(3)<=temp2(2);
temp2(4)<=temp2(3);
temp2(5)<=temp2(4);
temp2(6)<=temp2(5);
temp2(7)<=temp2(6);
temp2(8)<=temp2(7);
temp2(9)<=temp2(8);
temp2(10)<=temp2(9);
temp2(11)<=temp2(10);
temp2(12)<=temp2(11);
temp2(13)<=temp2(12);
temp2(14)<=temp2(13);
temp2(15)<=temp2(14);
temp2(16)<=temp2(15);
if (temp2(15)='1')then
mode1<="01";
end if;
temp2(1)<='0';
elsif(mode1(2)='1' and mode1(1)='1')then
temp2<="0000000000000000";
end if;
end if;
end if;

end process;
out_data12<=temp2;
end ty2_arch;
Lamp handball without counter

You might also like