Abstract: Method and apparatus for using a field-programmable gate-array circuit as a crossbar switch. In order to connect a first port of the crossbar switch to a second port, an address within the field-programmable gate-array circuit is calculated, and a first data pattern to load at that address is determined. A second data pattern to load at that address is determined in order to disconnect the first port from the second port. The first port is then connected to the second port by loading the first data pattern at the calculated address in the field-programmable gate-array circuit. Subsequently the first port is disconnected from the second port by loading the second data pattern at the calculated address in the field-programmable gate-array circuit. Mechanisms are provided for analog or digital ports, for multiple-bit digital ports, for combinations of logical functions with the crossbar-switch functions, and for latching the data within the crossbar switch.