Does the size of CCD/CMOS of a telescope affects the magnification? For a normal, traditional telescope, the magnification level should equal to focal length divided by eyepiece diameter, i.e.,
$$Res=\frac{f}{D}$$
So does the size of the CCD/CMOS the same as eyepiece diameter in this case? Or the magnification level is not affected by the size of the CCD/CMOS?
 A: The magnification of a telescope is the ratio of the focal length of telescope over the focal length of the eyepiece.  At least for a telescope that you want to look through with your eye. The equation you show in your question is the f-number $N=f/D$ with focal length $f$ and pupil diameter $D$.  There are a bit convoluted conventions for its usage, but in the end it characterizes the light collection of the telescope.
In the optical path of a telescope are focal planes and pupil planes:

*

*At focal planes the light is focused, i.e. one star is one dot.  The position in the focal plane is the position of the star, depending on the focal length.

*In pupil planes, where lenses sit, the light is spread out.  This means, all rays from the same object are parallel (ideally), and their angle encodes the position of the star.

The pupil of an eyepiece lies in the pupil plane, as the name suggests.  Its size does not affect magnification.  If it becomes smaller than the projected pupil of the telescope however it limits the aperture, because light from the telescope is lost.  This changes the f-number and basically reduces the brightness of the images.  The magnification is however affected by the eyepiece's focal length, and with it its distance to the focal plane of the telescope.
The CCD/CMOS detector is positioned in a focal plane.  Its size limits the field of view of the telescope (the size of the patch of sky that you can see).  Its size does not affect the magnification.
Besides aperture, magnification and field of view, a telescope is also characterized by its resolution.  For an ideal telescope (diffraction limited), the resolution is limited by the wavelength of the light and its pupil diameter $D$ (Rayleigh criterion). The resolution of the CCD chip, i.e. its pixel size, has to be designed correctly to sample the telescopes resolution correctly.
