Jorge Jesse Cantu
Junior Member level 1
- Joined
- Mar 3, 2014
- Messages
- 16
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 167
Hi guys, I have the following code:
And here is the following timing diagram for the code:
I get how the Hardware goes back to zero when strobe is asserted. But how do I know when strobe is asserted from the code? Why does it get asserted when Hardware = "10"? and why does the Hardware only count to "10" instead of "11"? I am trying to practice making timing diagrams from VHDL code. Also I do not know why SIGOUT is asserted in the timing diagram from the code. Some explanation would help me greatly!
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 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity MIDTERM2 is port(CLK : in STD_LOGIC; ACLR_L : in STD_LOGIC; SIGOUT : out STD_LOGIC); end Midterm2; architecture prob1 of MIDTERM2 is signal Strobe, IntNet : STD_LOGIC; signal Hardware : STD_LOGIC_VECTOR(1 downto 0); signal aclr : STD_LOGIC; begin aclr <= not ACLR_L; SIGOUT <= IntNet; Strobe <= ‘1’ when Hardware = “10” else ‘0’; process(CLK, aclr) begin if(aclr = ‘1’) then Hardware <= “00”; elsif(CLK’event and CLK = ‘1’) then if(Strobe = ‘1’) then Hardware <= “00”; else Hardware <= Hardware + 1; end if; end if; end process; process(CLK, aclr) begin if(aclr = ‘1’) then IntNet <= ‘0’; elsif(CLK’event and CLK = ‘1’) then IntNet <= Strobe; end if; end process; end prob1;
And here is the following timing diagram for the code:
I get how the Hardware goes back to zero when strobe is asserted. But how do I know when strobe is asserted from the code? Why does it get asserted when Hardware = "10"? and why does the Hardware only count to "10" instead of "11"? I am trying to practice making timing diagrams from VHDL code. Also I do not know why SIGOUT is asserted in the timing diagram from the code. Some explanation would help me greatly!