Weird problems with decoding instructions traced to a failed circuit bodge

NORMAL BEHAVIOR OF THE DECODER BOARD

The board should emit a signal for each of the eight instruction types but only during the Execute phase of instruction execution. The top three bits of the instruction are the instruction code and a 74LS259 chip is used to decode this to produce one and only one output. However, instead of latching and demuxing, the chip is used in a different way.

At the beginning of the fetch cycle, at time T0.5, it activates the clear pin which puts zero in all eight output latches. The three instruction bits are fed to the three selection inputs of the chip, which pick one of the eight output latches. 

Near the end of the fetch cycle, at time T22.5, it activates the enable pin which will transfer the value on the D input pin into the selected latch (out of eight latches). The D pin is wired to logic high, thus this turns on the bit in the selected latch. The three high bits of the instruction should be stable thus the chip is selecting just one latch.

The latch above remains in memory mode during the execute phase and other gates only emit the eight latch bits to the front panel when the Execute phase signal is active. We should only see an instruction code when in Execute, although it is activated during the fetch stage. 

WHAT I WAS OBSERVING

I would cycle through instructions and find that more than one of the operation codes were active during the execute phase. This clearly confuses all the remaining gating of signals to implement instructions, thus it is a primary error to correct.

MISSING CLEAR PIN ACTIVATION CAUSES THE SAME SYMPTOMS

If the clear pin of the 74ls259 is not activated at time T0.5 of the fetch cycle, then the latches retain whatever bits they had previously. Thus when I first power up and test an op code, it is displayed correctly. However, selecting another op code and testing it will light the new one plus the earlier one. 

BODGE IMPLEMENTED ON BOARD

An error in the layout of the PCB for the decoder had the clear and enable pin signals swapped. A bodge was suggested by cutting the two traces and soldering on small jumper wires to correct the condition. I soldered the wires to sections of the bare traces below where I had cut them, but the copper tore off during handling of the board and disconnected the clear pin wire. 

FIXING THIS WAS EASY

I simply found a more reliable point to solder the bodge wires to implement the criss-cross of the signals. With that done, I was back to seeing one and only one instruction type at a time. 

Comments

Popular posts from this blog

Bizarre behavior detected in a Raspberry Pi Pico based design and partially understood

Incompetent coders - the frustration of using Vivado to build FPGA designs

Found correct mod for the Arduino Mega 2560 to avoid powering it from USB