A few years ago the Sasad agricultural cooperative west of Budapest hired an electrical engineer away from a state enterprise and told him to putter around in his new workshop. He soon invented a precision device for controlling temperatures in grain silos.

From a business employing a dozen people in a small workshop, the enterprise has grown to one employing 300 in three buildings.

Automated equipment for soldering electronic circuitry has been imported from Hollis Engineering Co. in Nashua, N.H., and the precision devices produced here are exported.

As productive cottage industries have grown in the workshops of farm cooperatives and even the backyards of would-be inventors, a communist-style Silicon Valley is flourishing in the ramshackle suburbs around this Hungarian capital.

The government, which is looking for inventions that could be produced and sold to the West for needed convertible currency, has even established a special fund at the Exchange and Credit Bank to reward inventors of new technologies, to support research and demonstrate the feasibility of manufacturing new devices on a mass scale.

Hungary already has a track record of selling inventions to the West. It has sold a process for making hoses used to pump mud in oil-drilling operations. Another invention is spectrometers used to detect tiny defects in semiconductors.

Under a law that took effect Jan. 1, small entrepreneuers such as computer experts are able to form their own companies. Gyorgy Takacs, vice president of the Sasad agricultural cooperative, credits the Hungarian government for encouraging initiative at the 1,310 cooperatives around the country.

There are no quotas to fulfill, and Takacs says the co-op is free to branch out into whatever seems profitable. Current activities include operating a chain of 50 retail flower stores, construction, canning and cattle-raising.