The aggregate changes in the balance of gross unrecognized tax benefits, which excludes interest and penalties, for 2013, 2012 and 2011, is as follows (in millions):
| 2013 | 2012 | 2011 | ||||||||||
| 
  Beginning Balance  | 
 $ | 2,062 | $ | 1,375 | $ | 943 | ||||||
| 
  Increases related to tax positions taken during a prior year  | 
 745 | 340 | 49 | |||||||||
| 
  Decreases related to tax positions taken during a prior year  | 
 (118 | ) | (107 | ) | (39 | ) | ||||||
| 
  Increases related to tax positions taken during the current year  | 
 626 | 467 | 425 | |||||||||
| 
  Decreases related to settlements with taxing authorities  | 
 (592 | ) | (3 | ) | 0 | |||||||
| 
  Decreases related to expiration of statute of limitations  | 
 (9 | ) | (10 | ) | (3 | ) | ||||||
| 
  
  | 
 
  
  | 
 
  
  | 
 
  
  | 
 
  
  | 
 
  
  | 
 |||||||
| 
  Ending Balance  | 
 $ | 2,714 | $ | 2,062 | $ | 1,375 | ||||||
| 
  
  | 
 
  
  | 
 
  
  | 
 
  
  | 
 
  
  | 
 
  
  | 
 |||||||