Java implementation of cpu architecture