A novel routing algorithm, namely dynamic XY (DyXY) routing, is proposed for NoCs to provide adaptive routing and ensure deadlock-free and livelock-free routing at the same time. A new router architecture is developed to support the routing algorithm. Analytical models based on queuing theory are developed for DyXY routing for a twodimensional mesh NoC architecture, and analytical results match very well with the simulation results. It is observed that DyXY routing can achieve better performance compared with static XY routing and odd-even routing. Categories and Subject Descriptors: B.4.3 [Hardware]: Input/Output and Data Communication - Interconnections. General Terms: Algorithms, Performance, Design.