Switzerland was paired against the Czech Republic in Wednesday's draw for the opening round of the World Group. In other matches, Spain will travel to Canada, the United States will be at home against Brazil, and Argentina will host Germany.
Top-ranked Federer has a career 11-5 record against Berdych, but the No. 6 Czech defeated him in four sets at the U.S. Open. Berdych also beat Federer in the quarterfinals at Wimbledon in 2010 and at the 2004 Athens Olympics.
Switzerland will be at home for the Feb. 1-3 series. Federer does not always play in the early rounds of the Davis Cup and his plans for 2013 are uncertain.
Federer played in last weekend's playoff against the Netherlands, winning both singles matches to lead Switzerland to a 3-2 victory that ensured his country stayed in the World Group for 2013.
Berdych secured all three points for the Czechs in their semifinal win over Argentina. The Czechs will host Spain in the final Nov. 16-18.
The Czechs hold a 6-2 advantage against Switzerland, although the Swiss won the last time they met on home soil in 1998.
In other matches, it's France vs. Israel, Kazakhstan vs. Austria, Italy vs. Croatia and Belgium vs. Serbia.
Spain and Canada have met only once before, with Spain winning 4-1 at home on clay in 1991. But Canada, led by 15th-ranked Milos Raonic, will likely pick an indoor venue and fast surface that will make the conditions much tougher for the Spaniards.
"Canada was one of the strongest rivals we could have gotten, not only for the quality of a team led by Milos Raonic but also because we'll have to play as visiting team just one week after the Australian Open, which means another long trip and time change," Spain captain Alex Corretja said. "It will be a complicated tie."