The CO in syngas is reacted with steam to generate CO2 and H2 via the water-gas-shift reaction. In this simulation study, adsorbent AC5-KS and a dual-bed eight-step pressure swing adsorption (PSA) process is utilized to separate at room temperature H2 and CO2 from outlet stream from the water-gas-shift reactor. The purified H2 can be employed in a gas turbine for generating electrical power or can be used by other energy sources, whilst the CO2 can be recovered and sequestrated to reduce green-house-gas effects. In this paper it is assumed that the gas mixture from which water has been removed enters the PSA process. The feed gas entering the PSA process consists of 1.3% CO, 41.4% CO2 and 57.3% H2. It uses the method of lines combined with upwind differences, cubic spline approximation and LSODE of ODEPACK software to solve the results. The optimal operating condition is obtained by varying the operating variables, such as feed pressure, bed length and step time. It is shown that this process could achieve 100% purity and 79% recovery of H2 as the top product and about 76% purity and 100% recovery of CO2 as the bottom product.