Net revenues in both periods were impacted by the COVID-19 global pandemic. Our net revenues continue to demonstrate the challenges that we are facing during the COVID-19 global pandemic, which has restricted the activities of our sales force and distributors, reduced customer demand and caused the postponement of investment in certain customer sectors. These challenges continue to impact us as we enter new markets and engage with target customers. Industry conferences and on-site training workshops, which are typically used for building a sales pipeline, have been unavailable due to COVID-19 related restrictions. We have adapted our sales strategies for the COVID-19 environment as there are limitations with both in-person and virtual meetings, particularly, government and defense customers with regards to secure teleconferencing. However, we are still not operating at an optimal level.
The overall average selling price of all units shipped in the quarter ended June 30, 2021 increased by 23.0% compared to the quarter ended June 30, 2020 and the number of units shipped increased 5.8% in the quarter ended June 30, 2021 compared to the quarter ended June 30, 2020. The changes in the average selling price were due to changes in product mix, as we sold more higher density, higher average selling price products in the fiscal 2022 period compared to the prior fiscal year period. Direct and indirect sales to Nokia, currently our largest customer, increased from $1.8 million in the three months ended June 30, 2020 to $3.8 million in the three months June 30, 2021. Shipments to Nokia in the quarter ended June 30, 2021 included approximately $1.1 million of buffer stock in anticipation of perceived market tightness. Shipments of our SigmaQuad product line accounted for 46.3% of total shipments in the three months ended June 30, 2020 and compared to 63.6% of total shipments in the three months ended June 30, 2021. The changes in SigmaQuad shipments were primarily due to the changes in sales to Nokia discussed above.
Cost of Revenues. Cost of revenues increased by 12.3% from $3.6 million in the three months ended June 30, 2020 to $4.0 million in the three months ended June 30, 2021. Cost of revenues included a provision for excess and obsolete inventories of $159,000 in the three months ended June 30, 2020 compared to $160,000 in the three months ended June 30, 2021. Cost of revenues included stock-based compensation expense of $88,000 and $70,000 for the three months June 30, 2020 and 2021, respectively.
Gross Profit. Gross profit increased by 56.8% from $3.1 million in the three months ended June 30, 2020 to $4.8 million in the three months ended June 30, 2021. Gross margin increased from 46.1% in the three months ended June 30, 2020 to 54.4% in the three months ended June 30, 2021. The change in gross profit is primarily related to the change in net revenues discussed above. The change in gross margin is primarily related to changes in the mix of products and customers.
Research and Development Expenses. Research and development expenses increased by 4.8% from $5.8 million in the three months ended June 30, 2020 to $6.1 million in the three months ended June 30, 2021. The increase in research and development spending was primarily related to an increase of $352,000 in payroll related expenses partially offset by lesser decreases in patent related legal fees and outside consulting expenses. Research and development expenses included stock-based compensation expense of $413,000 and $470,000 for the three months ended June 30, 2020 and 2021, respectively.
Selling, General and Administrative Expenses. Selling, general and administrative expenses increased by 4.1% from $2.9 million in the three months ended June 30, 2020 to $3.0 million in the three months ended June 30, 2021. An increase of $121,000 for independent sales representatives commissions was partially offset by decreases in payroll related expenses and professional fees. Selling, general and administrative expenses included stock-based compensation expense of $254,000 and $283,000 for the three months ended June 30, 2020 and 2021, respectively.
Interest Income and Other Income, Net. Interest and other income, net decreased by $126,000 from income of $106,000 in the three months ended June 30, 2020 to an expense of $20,000 in the three months ended June 30, 2021. Interest income decreased by $91,000 primarily due to lower interest rates received on our cash and short-term and long-term investments and a lesser amount of investments. Foreign exchange losses were $8,000 for the three months ended June 30, 2020 compared to $43,000 for the three months ended June 30, 2021. The exchange losses in each period were related to our Taiwan branch operations and our operations in Israel.
Provision (benefit) for Income Taxes. The provision (benefit) for income taxes decreased from a provision of $487,000 in the three months ended June 30, 2020 to a benefit of ($172,000) in the three months June 30, 2021.