I'd like to quote from the 1997 UBC
310.9.1.4 Location within dwelling unit.
...a detector shall be installed in each sleeping room and at a point centrally located in the corridor or area giving access to each separate sleeping area. When the dwelling has more than one story, and in dwellings with basements, a detector shall be installed on each story and in the basement. In dwelling units where a story or basement is split into two or more levels, the smoke detector shall be installed on the upper level, except that when the lower level contains a sleeping area, a detector shall be installed on each level. When sleeping rooms are on an upper level, the detector shall be placed at the ceiling of the upper level in close proximity to the stairway.....where the ceiling heigth of a room open to the hallway serving the bedrooms exceeds that of the hallway by 24 inches or more, smoke detectors shall be placed in the hallway and in the adjacent room..."
As I read this, you have to put one at the top of the stairs.