Millimeter-wave and terahertz signal generation and detection in silicon