Mar 5, 2007 #1 B Bond_2007 Newbie level 5 Joined Mar 5, 2007 Messages 8 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,316 Hello, I would like to use the following case statement: test_bits<bit1,bit0> case 00: Make IO output PIN 7 high. case 01: Make IO output PIN 8 high. If case 00 has ran, the IO PIN 7 is high, will it stays high even when case 01 is running? Is this a latch operation? I am new to CPLD, any help is appreciated. -B
Hello, I would like to use the following case statement: test_bits<bit1,bit0> case 00: Make IO output PIN 7 high. case 01: Make IO output PIN 8 high. If case 00 has ran, the IO PIN 7 is high, will it stays high even when case 01 is running? Is this a latch operation? I am new to CPLD, any help is appreciated. -B
Mar 6, 2007 #2 N nand_gates Advanced Member level 3 Joined Jul 19, 2004 Messages 899 Helped 175 Reputation 350 Reaction score 53 Trophy points 1,308 Activity points 7,037 Yes ur right! This will create a latch for both PIN7 and PIN 8 because you have not specified what value to drive on these pins under all possible conditions!
Yes ur right! This will create a latch for both PIN7 and PIN 8 because you have not specified what value to drive on these pins under all possible conditions!
Mar 6, 2007 #3 B Bond_2007 Newbie level 5 Joined Mar 5, 2007 Messages 8 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,316 any other inputs are greatly appreciated. -B
Mar 7, 2007 #4 V vlsi_whiz Full Member level 4 Joined Nov 12, 2005 Messages 216 Helped 49 Reputation 98 Reaction score 24 Trophy points 1,298 Location Penang Activity points 3,139 As stated above, the code will result in two latches. To avoid latches use the following code structure: Code: test_bits<bit1,bit0> case 00: Make IO output PIN 7 high. Make IO output PIN 8 low. case 01: Make IO output PIN 8 high. Make IO output PIN 7 low. You can also use the IF statement to do the same.
As stated above, the code will result in two latches. To avoid latches use the following code structure: Code: test_bits<bit1,bit0> case 00: Make IO output PIN 7 high. Make IO output PIN 8 low. case 01: Make IO output PIN 8 high. Make IO output PIN 7 low. You can also use the IF statement to do the same.