I think the task should be a bit clearer on what is expected exactly. I was imagining a much more difficult solution, that would only count the edge of each pulse.
This is a very nice exercise - it really shows the strength of Simulink.
I have two comments, though:
a) The speed output is expected in rpm - that should be specified.
b) The inductance of 0.5 H seems rather high. I would expected that to be at least 10 times smaller for a 'normal' motor.