please provide a solution for Timing Diagram

Status
Not open for further replies.

Anupama shetter

Newbie level 1
Joined
Oct 21, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
23
Hello All,

I am engineering student i want write a code in vhdl go get the simulations as per the picture attached and tried doing that but not getting please help me with the code.

thankyou,





Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.NUMERIC_STD.ALL;
 
entity DLR2416 is
    Port ( CLK : in std_logic; 
           reset :in std_logic;
           enable : in std_logic;
           WRbar : out STD_LOGIC;
           CEbar : out STD_LOGIC;
           CLRbar : out STD_LOGIC;
           A0A1 : inout STD_LOGIC_vector(1 downto 0);
           data : out STD_LOGIC_VECTOR (6 downto 0));
end DLR2416;
 
architecture Behavioral of DLR2416 is
 
constant Lu_t : std_logic_vector (6 downto 0) := "0000001";
constant Lu_a : std_logic_vector (6 downto 0) := "1001111";
constant Lu_c : std_logic_vector (6 downto 0) := "0000110";
constant Lu_d : std_logic_vector (6 downto 0) := "0000000";
constant Lu_f : std_logic_vector (6 downto 0) := "1111111";
 
 
signal I :STD_LOGIC_vector(1 downto 0);
--signal temp :STD_LOGIC_vector(1 downto 0);
 
begin
 
 
process (CLK,reset,enable,I)
variable COUNT : integer;
    begin
        if (CLK'Event and CLK = '1' and enable = '1') then
                                
                                  
        if( reset = '0')then
               
          if( count = 0 ) then
                CEbar <= '1';
                CLRbar <= '0';         
                A0A1 <= I;
                --WRbar <= '1';    
          end if; 
          if( count = 1 ) then
               CEbar <= '0';
               CLRbar <= '1';         
               A0A1 <= I;
               --WRbar <= '1';
                
          end if;     
          if(count < 10)then
               CEbar <= '0';
               CLRbar <= '1';                         
               A0A1 <= I;
               --WRbar <= '1'; 
                       
          end if; 
          if(count <= 90)then
               CEbar <= '0';
               CLRbar <= '1';                         
               A0A1 <= I;
               --WRbar <= '0';       
                   case A0A1 is   
                       when "00" => data <= Lu_t;
                       when "01" => data <= Lu_a;
                       when "10" => data <= Lu_c;
                       when "11" => data <= Lu_f;
                       when others => data <= Lu_d;      
                   end case;
                
         end if;            
         if(count <= 140)then
               CEbar <= '0';
               CLRbar <= '1';                         
               A0A1 <= I;
               --WRbar <= '1';  
                             
         end if;      
     COUNT <= COUNT + '1';
      --elsif(reset = '1')then
      else
                 CLRbar <= '0';
                 count := 0; 
                 CEbar <= '1';
                 A0A1 <= I; 
                 WRbar <= '1';
          end if;       
      --end if;
    end if;  
    end process;
end Behavioral;

 
Last edited by a moderator:

What exactly is the problem? have you got a testbench to simulate the code?

One point : the enable signal should be inside the clock. Your current code could be implemented as a gated clock enable, which is not a good idea in FPGA.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…