[Tex/LaTex] Text under equation

math-modetext;

I'm trying to achieve which can be best described from this picture:

green stuff

I want to be able to write the green text and line under my equation (it's exactly this equation actually) but how do I do that? All I have at the moment is:

\noindent read stall cycles = \(\displaystyle \frac{reads}{program}\ *\ read\ 
miss\ rate\ (\%)\ *\ read\ miss\ penalty\ (cycles)\)

Best Answer

Just for fun (this may not be the optimal way of doing this):

\documentclass[12pt]{article}
\pagestyle{plain}
\usepackage[margin=1.8cm]{geometry}
\geometry{a4paper}
\usepackage[parfill]{parskip}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[usenames]{color}
\definecolor{cyan}{rgb}{0,1,1}
\newcommand{\cyan}[1]{\textcolor{cyan}{#1}}
\definecolor{black}{rgb}{0,0,0}
\newcommand{\black}[1]{\textcolor{black}{#1}}

\begin{document}

\[
  \text{read stall cycles} =
  \cyan{\underbrace{\black{\frac{\text{reads}}{\text{program}}
        \times \parbox{48pt}{read miss \\ rate (\%)}}}_{\text{read
        miss per program}}} \times
  \cyan{\underbrace{\black{\parbox{76pt}{read miss \\ penalty
          (cycle)}}}_{\parbox{62pt}{\scriptsize\centering number of cycles \\
        per read miss}}}
\]

\end{document}

enter image description here

Related Question