The error message you received clearly shows that you've already run the Apple Hardware Test, so let's see if we can figure out how to resolve your issue. It would be helpful to know which model iMac you have and the size of the display. Some iMac's have two memory slots, others have four, and some are not upgradeable. The error you received indicates a memory issue that could be the result of a faulty memory module, a memory module that doesn't meet the required specifications, or a poor connection between the memory module and the connector on the logic board. I suggest doing the following:
1) Power down your iMac, then remove and reseat the memory modules (DIMM's). Inspect the gold contacts on the DIMM's to see if they are contaminated with any corrosion, dirt, etc. Restart the iMac and see if AHT gives you the same error.
2) If the error persists, and you have 4 memory modules installed in the iMac, try removing two of the four DIMM's (Make sure the remaining two DIMM's are the same capacity) and then restart the iMac and run AHT. If the two DIMM's pass, remove them and reinstall the two remain DIMM's and run AHT again. If there is a bad DIMM you'll need to replace it. For more information on iMac memory check out this article:
Install memory in an iMac - Apple Support
When you remove the DIMM's from the iMac, compare the information printed on the DIMM labels with the appropriate memory specification section in the article I linked to earlier to confirm whether they are compatible with your iMac.
Once you provide more detailed information about your system we may be able to offer additional suggestions.