I have a problem with the bit WireM , i have write a code HDL who can determine the destination of the output of an instruction , by simplification i have deduce that the d3 is the only bit to determine the memory destination , but in the tst file i have found the first instruction @12345 , have a 111 for d1d2d3 , in this case the destination is AMD , but in the tst file the writeM bit is set to 0 , so this is a contradiction which i don't found a solution .
i need a help , please .
What you are missing is that the 'd3' bit (an all the other named bits) is only relevant in C-instructions.
During A-instructions, none of the C-instructions actions—writing to registers/memory, jumping, etc.—should occur.
The easiest way to handle this is to make two signals, aInst and cInst, that are active only during their type of instruction.
cInst will be False during A-instructions so you can use it to make sure that writeM will never be True except during C-instructions.