Thread Closed

VHDL Code: Testing Equality of Vectors

 
Share Thread Thread Tools
Dec1-07, 11:21 PM   #1
 

VHDL Code: Testing Equality of Vectors


Hi all, I have the following code:

if (checkHR(7 downto 4) = HRH) and (checkHR(3 downto 0) = HRL)
and (checkMIN(7 downto 4) = MINH) and (checkMIN(3 downto 0) = MINL) then

SECL <= "0000";
SECH <= "0000";
MINL <= "1000"; -- set to 8888 to notify alarm has been set
MINH <= "1000"; -- set to 8888 to notify alarm has been set
HRL <= "1000"; -- set to 8888 to notify alarm has been set
HRH <= "1000"; -- set to 8888 to notify alarm has been set
where checkHR and checkMIN are 8 bit vectors (7 downto 0)... and SECL, SECH, MINL, MINH, HRL, and HRH are all 4 bit vectors (3 downto 0).

What I'm trying to do is check to see if the first four bits of checkHR is equal to HRH.

Can someone tell me whats wrong? I'm getting the error: Line 74. = can not have such operands in this context.
PhysOrg.com
PhysOrg
engineering news on PhysOrg.com

>> Company pioneering new types of material for 3-D printer 'ink'
>> Student-built innovations to help improve and save lives
>> Researchers use light projector and single-pixel detectors to create 3-D images
Dec2-07, 04:29 PM   #2
 
Did you put the code inside a process? You can only use the "if" statement inside a process.
Dec2-07, 10:56 PM   #3
 
Yes, it's in a process.
Dec3-07, 03:27 PM   #4
 

VHDL Code: Testing Equality of Vectors


In the portion of code that you posted there is no syntax error. There must be some conflicting code somewhere else. You should post the whole process. Also tell us which of SECL, SECH, MINL, MINH, HRL, HRH, checkHR and checkMIN, are signals and which are ports.
Thread Closed
Thread Tools


Similar Threads for: VHDL Code: Testing Equality of Vectors
Thread Forum Replies
VHDL tutorial Electrical Engineering 11
Convert latex code to fortran code? Math & Science Software 1
I need help in VHDL synthesis Electrical Engineering 5
VHDL for starters Programming & Comp Sci 0
Help with VHDL Electrical Engineering 2