Increased counter in w_mem to 7 bits. Now the core works.