Search code examples
simulationcpumips32

Why does the counter in logisim add 2 a time


enter image description here

I'm trying to implement a mips cpu and using a counter to mark down the cycles of execution of the benchmark programes. you can see from the gif above, I'm trying to use a counter to count the total cycle of programe's execution, but when the counter reaches 9 it turned into b(hex) immediately, i thought it could be a noise to trigger this, but a and gate is connected to the clock port of the counter , so any noise would be erased by the and gate(i think) , and then I don't know what else can trigger this . so can anyone help? thank you for your time.

another thing, the counter skips 1 every 10 cycles

the Chinese in the label means total cycle count

and here is the big picture of the circit

the pink component is controller

the rom on the left is the instruction rom

the ram on the right is the data ram enter image description here


Solution

  • It's wrong to think that an add gate can erase the niose(It cant) just do this and the problem was solved enter image description here