Question about cylinders

Heres a question that is probably obvious to everyone here but me. On a “modern” steam locomotive, a 4-8-4, for example. I notice that they seem to have two cylinders on each side, one on top of the other. Are each of them cylinders, making them compound engines? Or is the top “cylinder” something else entirely, like maybe valves or something?

Thanks,

Your deduction is correct; the upper “cylinder” on a simple locomotive is the valve.

RWM

Here’s a handy-dandy site that should give you some insight into the whole works.

http://home.new.rr.com/trumpetb/loco/