BlackOps
Full Member level 5
- Joined
- Jan 1, 2005
- Messages
- 279
- Helped
- 14
- Reputation
- 28
- Reaction score
- 3
- Trophy points
- 1,298
- Location
- AZERBAIJAN
- Activity points
- 2,496
vga vhdl
Hello,
i am trying to code the behavioral VHDL model of the VGA Horizontal counter, from the Enochs book. (as some people have adviced me to make simple things in behavioral model. And i will connect all elements in structural code in the Top source file). Please take a look at the picture of the schematic of Horizontal counter from the book.
here is my code:
meaning of this counter is, when it reaches 800, the Rollover is 1, and it begins counting from 0 again.. so.. as you can see i have combined code of 10 bit counter to fit my problem, and removed unused Count and Load inputs. Because HCount elemtn will have only: Clock,CLear,H_cntD,H_cntDE,H_cntDEB,H_cntDEBC,Rollover, and 10 bit Q outputs
please could you say me is this code ok? if no could u please fix the errors.
during compile in Modelsim it gives me this:
But i dont understand what it wants to say with this..
thank you
Hello,
i am trying to code the behavioral VHDL model of the VGA Horizontal counter, from the Enochs book. (as some people have adviced me to make simple things in behavioral model. And i will connect all elements in structural code in the Top source file). Please take a look at the picture of the schematic of Horizontal counter from the book.
here is my code:
Code:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL; -- need this to add STD_LOGIC_VECTORs
ENTITY HCount IS PORT (
Clock: IN STD_LOGIC;
Clear: IN STD_LOGIC;
Rollover: OUT STD_LOGIC;
H_cntD: OUT STD_LOGIC;
H_cntDE: OUT STD_LOGIC;
H_cntDEB: OUT STD_LOGIC;
H_cntDEBC: OUT STD_LOGIC;
Q : OUT STD_LOGIC_VECTOR(9 DOWNTO 0));
END HCount;
ARCHITECTURE Behavioral OF HCount IS
SIGNAL value: STD_LOGIC_VECTOR(9 DOWNTO 0);
BEGIN
PROCESS (Clock, Clear)
BEGIN
IF Clear = '1' THEN
value <= (OTHERS => '0');
ELSIF (Clock'EVENT AND Clock='1') THEN
value <= value + 1;
END IF;
IF (value = B'1010000000') THEN -- TEST FOR 640
H_cntD <= '1';
ELSIF
(value = B'1010010100') THEN -- TEST FOR 660
H_cntDE <= '1';
ELSIF
(value = B'1011110011') THEN -- TEST FOR 755
H_cntDEB <= '1';
ELSIF
(value = B'1100100000') THEN -- TEST FOR 800
H_cntDEBC <= '1' & Rollover <= '1' & value <= (OTHERS => '0');
END IF;
END PROCESS;
Q <= value;
END Behavioral;
meaning of this counter is, when it reaches 800, the Rollover is 1, and it begins counting from 0 again.. so.. as you can see i have combined code of 10 bit counter to fit my problem, and removed unused Count and Load inputs. Because HCount elemtn will have only: Clock,CLear,H_cntD,H_cntDE,H_cntDEB,H_cntDEBC,Rollover, and 10 bit Q outputs
please could you say me is this code ok? if no could u please fix the errors.
during compile in Modelsim it gives me this:
Code:
HCount.vhd(29): near "1010000000": expecting: '(' IDENTIFIER RANGE
HCount.vhd(32): near "1010010100": expecting: '(' IDENTIFIER RANGE
HCount.vhd(35): near "1011110011": expecting: '(' IDENTIFIER RANGE
HCount.vhd(38): near "1100100000": expecting: '(' IDENTIFIER RANGE
HCount.vhd(39): near "<=": expecting: ';'
But i dont understand what it wants to say with this..
thank you