[tex]\\ \rm\Rrightarrow Molarity=\dfrac{Moles\:of\:solute}{Volume\:of\: solution \:in\:L}[/tex]
[tex]\\ \rm\Rrightarrow 1=\dfrac{n}{0.5}[/tex]
[tex]\\ \rm\Rrightarrow n=0.5mol[/tex]
[tex]\\ \rm\Rrightarrow n=\dfrac{Given\:mass}{Molar\:mass}[/tex]
[tex]\\ \rm\Rrightarrow 0.5=\dfrac{Given\:mass}{40}[/tex]
[tex]\\ \rm\Rrightarrow Given\:mass=40(0.5)=20g[/tex]