You can do this with taskset :
taskset 0x03 your_command
will launch your_command on the cpus #0 and #1.
your_command